I have App.vue component and its child ItemsList.vue.
In App.vue I have this:
export default {
name: 'App',
components: {
ItemsList
},
data() {
return {
items_list: [
getRandomItem(),
getRandomItem(),
getRandomItem(),
]
}
}
}
The data is an array of randomly generated items of the same structure.
I want to return a new array of newly generated items when clicking a button but as I see, data() method is being called only once on start and then return just what was generated at the moment.
How do I rerun this method to return a new dataset?
items_listwhen button clicked like @zero298 said)