el-popover组件及其他elementUI组件阻止事件冒泡的方法

3,324 阅读1分钟

el-popover 触发父元素事件解决方法~

  • 解决办法很简单,就一行,喏~
  • 在外层嵌套一层 div ,我这里是行内元素 我就加了个 span ,然后加上 @click.stop
<span @click.stop>
    <el-popconfirm
      confirmButtonText='好的'
      cancelButtonText='不用了'
      icon="el-icon-info"
      iconColor="red"
      title="这是一段内容确定删除吗?"
    >
      <el-button slot="reference">删除</el-button>
    </el-popconfirm>
</span>