DEV Community


Discussion on: Introduction to Vue Watchers

kennyrafael profile image
kennyrafael • Edited

Would be nice to add immediate: true. This way you can do something like this:

selectedAuthor: {
      handler: 'fetchPosts',
      immediate: true
data: function () {
      selectedAuthor: 0,
      authors: [...]
Enter fullscreen mode Exit fullscreen mode

immediate: true means your handler will trigger when the component is mounted, and again when the property changes.

lindaojo profile image