0👍
You need to return ‘brandNames’ after map info.
Notice: Also you can call this method in created() hooks before component mounted(). This useful to get response before initialize template.
Good luck
- [Vuejs]-Vue 3 – Svgator player is always undefined
- [Vuejs]-Vue – refresh state on clicking back button in the browser
0👍
I found the solution. The error was that the api call needed the promise response. For this I created an "async" method that waits for the data to be returned before passing it to the list
export default {
data: function () {
return {
filter: null,
brandNames: null,
};
},
created() {
this.fetchBrandNames()
},
methods: {
async fetchBrandNames() {
const response = await Nova.request().get('/nova-vendor/export/brands-list');
this.brandNames = response.data;
}
}
}
Source:stackexchange.com