Element: button按钮绑定的事件怎么没有触发?

Created on 11 Oct 2016  ·  2Comments  ·  Source: ElemeFE/element

如有这么一个按钮:

<el-button type="info" v-on:click="UserLogin">登陆</el-button>

绑定了UserLogin事件

methods: {
      UserLogin: function (event) {
        console.log("触发")
      }
    }

然后并没有触发,但是如果放一个普通的button按钮就会触发,这是为何?

Most helpful comment

64

All 2 comments

64

自定义组件如果要触发dom事件的话,需要加native修饰符。

Was this page helpful?
0 / 5 - 0 ratings