3๐
โ
As far as I understood your question:
You could call sortMyItems(items)
in the created
Lifecycle Hook and store the result in a property of data
.
Then, you can iterate over that property in your v-for
:
export default {
data() {
return {
sortedData: [];
}
},
created() {
this.sortedData = sortMyItems(items)
}
}
Source:stackexchange.com