0👍
Seems you at least need to place the method inside beforeMount() hook?
Also, defining a data model for a component is a good practice
// methods: {...},
data(){
return {
items: null
}
},
// mounted: {...}
- [Vuejs]-Vue.js table sorting (HTML & Buefy)
- [Vuejs]-Vue.js Firebase RealTime DB Rules – set rules for property modified by app function
0👍
in the success:
portion of your ajax method change that.items
to this.items
where (as @mannok said) items is defined in your vue instance data property. Also, this.$forceUpdate()
is probably unnecessary. Vue will automatically update when data changes (as long as you aren’t adding properties to an existing object or array).
Source:stackexchange.com