Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

vue watch immediate

// Passing in immediate: true in the option will trigger the callback immediately with the current value of the expression:

vm.$watch('a', callback, {
  immediate: true
})
// `callback` is fired immediately with current value of `a`

var vm = new Vue({
	watch: {
		d: {
  			handler: 'someMethod',
    		immediate: true
		}
	}
}
Source by v2.vuejs.org #
 
PREVIOUS NEXT
Tagged: #vue #watch
ADD COMMENT
Topic
Name
2+4 =