0👍
✅
You need to use watchers here, which suits exactly your use-case:
This is most useful when you want to perform asynchronous or expensive operations in response to changing data.
Method is not executed as you are not returning anything from it, which depends on the vue data variable.
You have to invoke your method when paginationCount
variable changes:
data: {
careerData: [],
paginationCount: 0
},
watch: {
// whenever paginationCount changes, this function will run
paginationCount: function (newPaginationCount) {
this.fetchData();
}
},
Source:stackexchange.com