用 jsx 来写 vue 的组件,需要监听 .sync 修饰符的事件,找不到文档,我试过下面的方法,但是并不行。<MyComponent visible={this.visible} {...{['on-update:visible']: console.log}} />求问,正确的写法应该要怎样呢?
2 回答
富国沪深
TA贡献1790条经验 获得超9个赞
在 babel-plugin-transform-vue-jsx 的 example 中找到了答案,可以这样写:
<MyComponent visible={this.visible} {...{on:{'update:visible': console.log}}} />添加回答
举报
0/150
提交
取消
