element [Bug Report] el-popconfirm事件绑定不生效

j0pj023g  于 4个月前  发布在  其他
关注(0)|答案(3)|浏览(104)

Element UI version

2.13.2

OS/Browsers version

window10 Microsoft Edge 版本 81.0.416.77 (官方内部版本) (64 位)

Vue version

2.6.11

https://github.com/chinaguopeng/element-el-popconfirm

Steps to reproduce

下载index.html 在浏览器打开

What is Expected?

点击确认按钮,事件生效

What is actually happening?

点击确认按钮,事件不生效

8aqjt8rx

8aqjt8rx2#

@chinaguopeng

可以自己实现一个组件重写 confirm 解决

<script>
import { Popconfirm } from 'element-ui'

export default {
extends: Popconfirm,
methods: {
confirm() {
this.visible = false;
this.$emit('on-confirm');
}
},
mounted () {

}
}
</script>

<style scoped>

</style>
<popconfirm
    confirmButtonText='OK'
    cancelButtonText='No, Thanks'
    icon="el-icon-info"
    v-on:on-confirm="truncateall"
    iconColor="red"
    title="Are you sure to clear all?"
>
    <el-button slot="reference" type="danger">CLEAR ALL</el-button>
</popconfirm>
u59ebvdq

u59ebvdq3#

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

相关问题