Blogger Information
Blog 51
fans 0
comment 1
visits 70506
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
vue api实例方法 有四个 $watch $emit $forceUpdate $nextTick!
呵呵哒
Original
880 people have browsed it

实例

1、$watch :侦听组件实例上的响应式 property 或函数计算结果的变化。回调函数得到的参数为新值和旧值。


2、$emit:触发当前实例上的事件。附加参数都会传给监听器回调。



3、$forceUpdate:迫使组件实例重新渲染。注意它仅仅影响实例本身和插入插槽内容的子组件,而不是所有子组件。


4、$nextTick:将回调延迟到下次 DOM 更新循环之后执行。在修改数据之后立即使用它,然后等待 DOM 更新。它跟全局方法 nextTick 一样,不同的是回调的 this 自动绑定到调用它的实例上。

运行实例 »

点击 "运行实例" 按钮查看在线实例


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post
  • 1
    2018-03-17 17:09:25