We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[vue] 怎么在watch监听开始之后立即被调用?
The text was updated successfully, but these errors were encountered:
有个参数immediate https://cn.vuejs.org/v2/api/#vm-watch
immediate
Sorry, something went wrong.
let vm=new Vue({ el:"#first", data:{msg:'liuneng'}, watch:{ msg:{ handler (newMsg,oldMsg){ console.log(newMsg); }, immediate:true } } })
设置immediate属性为true
选项:immediate
在选项参数中指定 immediate: true 将立即以表达式的当前值触发回调
直接添加watch.监听对象.immediate = true就ok
No branches or pull requests
[vue] 怎么在watch监听开始之后立即被调用?
The text was updated successfully, but these errors were encountered: