Vue2 修饰符 sync
修饰符
修饰符可以简化代码
事件修饰符
在事件处理程序中调用 event.preventDefault() 或 event.stopPropagation() 是非常常见的需求。
.stop 阻止事件继续传播
.prevent
.capture 用事件捕获模式
.self 只当在 event.target 是当前元素自身时触发处理函数
.once 事件将只会触发一次
.passive
内容很多···
.sync
<my-component :foo.sync="bar"></my-component>
等价于
<my-component :foo="bar" @update:foo="value => bar = value"></my-component>
内容会不断更新,欢迎批评指正。

浙公网安备 33010602011771号