1👍
You have to return the data from the function, not expect the "return variable" as another parameter, that’s not how it works.
callAPI(params: string) {
return axios
.get(`https://printful.com/test-quiz.php?action=${params}`)
.then((res) => {
return res.data;
});
},
},
async created() {
this.quizzAllCategories = await this.callAPI("quizzes");
},
-2👍
ESLint lint behavior is right. You’ve declared assignment and assigned it a value, but u aren’t using it in your Code anywhere.
Solution: It should disappear if use it anywhere:)
Solution 2 which is not recommended: you can disable it by adding these, before this line
// eslint-disable-next-line no-unused-vars
assignment = res.data
/* eslint-enable no-unused-vars */
- [Vuejs]-Laravel + Vue Js : How can i hide a bootstraps 4 modal on getting response from Axios request
- [Vuejs]-Vuejs component with html attribute
Source:stackexchange.com