I am using laravel 5.8 with vue js. I have created a generalized function for post/get requests. The problem is, i am not getting the mixins function response. Here is my code :
TestComponent.vue
import GeneralMixin from '../mixins.js';
export default {
mixins: [ GeneralMixin ],
methods:{
login: function (e) {
response = this.testMixin();
console.log(response);
}
}
}
mixin.js
export default {
methods: {
testMixin: function () {
url = '/test';
axios.post(url).then(function(response, status, request) {
return response;
});
}
}
}
I am not getting response of function testMixin()
. Can anyone help please
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire