-1👍
I suppose that in this
you have no vue
instance, but axios
.
Define before axios let vue = this;
, somethink like this:
logIn: () => {
let vue = this;
axios
.post("http://127.0.0.1:8000/auth/token/login/", {
email: "test2@test.com",
password: "password"
})
.then(response => {
vue.authtoken = response.authtoken;
})
.catch(error => {
vue.error = error;
});
}
- [Vuejs]-How to change the value of a prop (or data) of a component, from OUTSIDE the component?
- [Vuejs]-Unknown extra item appearing in list (firebase)
Source:stackexchange.com