Up to this point, I've been attempting to set the value of an object property to false using @click='review.isActive = true'
. However, it appears that Vue cannot detect these changes, causing the property to not be reactive.
According to the documentation found at https://v2.vuejs.org/v2/guide/list.html#Caveats, there are alternative methods to avoid this issue:
Vue.set(vm.reviews, index, true)
vm.reviews.splice(index, 1, true)
Unfortunately, I encountered errors when trying both approaches. It seems like I lack a full understanding of how the Vue instance operates and may be attempting to access it incorrectly.
I presume that Vue/vm refer to the Vue instance, but for some reason, I can't seem to interact with it.
In both instances, I receive the error message "Property or method 'vm'/'Vue' is not defined on the instance but referenced during render."
Using the Vue webpack-simple webpack template, my Vue instance is initialized in the main.js file as shown below:
var vm = new Vue({
el: '#app',
router: router,
store: store,
render: h => h(App)
});
The array manipulation takes place in a different file within a component.