给Vue组件绑定事件,需要在事件后面加上.native,比如:<el-input @click.native.enter="login">,相当于$emit("click".fn)。
有一天突然发现使用el-button的时候是这样的:

<el-button @click="handler"></el-button>

是因为element-ui已经在el-button组件源码中给我们this.$emit('click', evt)事件了

相关文章:

  • 2021-09-11
  • 2021-06-28
  • 2022-12-23
  • 2021-08-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-06
  • 2022-12-23
相关资源
相似解决方案