<el-button type="text" icon="edit" @click="edit(1)"></el-button>
edit(index) {
console.log(index);
}
点击按钮无法触发edit事件
<el-button @click.native="edit">默认按钮</el-button>
@TDiDa 看到你的代码了,补充一下,Vue2中自定义组件都需要.native
才能使用原生事件。
@csvwolf 可以了,多谢
jsx 的这个语法是什么?
nativeOn
@csvwolf 你好,你说VUE2,要加.native才能监听原生事件,这是什么意思啊,难道还有自定义的onclick事件吗?
@DanielWLam
https://github.com/ElemeFE/element/blob/master/FAQ.md
建议看一下Vue2的文档
Most helpful comment
@TDiDa 看到你的代码了,补充一下,Vue2中自定义组件都需要
.native
才能使用原生事件。