Accessing $refs Array Inside A Vue Js Instance Watch Object
I am building a Vue JS SPA, and have a Vuetify data-table inside of the v-app. I am trying to set a variable inside the watch object for the filteredItems computed property inside
Solution 1:
The best way is to add watcher on the mounted. Try the following code.
mounted(){
this.$watch(
() => {
returnthis.$refs.prospectsTable.filteredItems
},
(val) => {
console.log(val)
alert('App $watch $refs.counter.i: ' + val)
}
)
}
Codepen - https://codesandbox.io/s/j7wjjypnxw
Post a Comment for "Accessing $refs Array Inside A Vue Js Instance Watch Object"