Answers for "cuejs watch immediate deep"

8

vue deep watch

watch: {
    colors: {
        handler(newValue){
            console.log('colors changed', newValue)
        }, deep: true
    }
}
Posted by: Guest on October-27-2020
0

using the watch method to monitor route updates in vue

watch: {
  // Whenever the movie prop changes, fetch new data
  movie {
    handler: 'fetchData'
  },
  // Whenever the actor changes, we'll call the same method
  actor: {
    handler: 'fetchData',
  }
},

methods: {
  // Fetch data about the movie
  fetchData() {
    fetch(`/${this.movie}/${this.actor}`).then((data) => {
      this.movieData = data;
    });
  }
}
Posted by: Guest on September-03-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language