Open chinaguopeng opened 4 years ago
@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>
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.
Element UI version
2.13.2
OS/Browsers version
window10 Microsoft Edge 版本 81.0.416.77 (官方内部版本) (64 位)
Vue version
2.6.11
Reproduction Link
https://github.com/chinaguopeng/element-el-popconfirm
Steps to reproduce
下载index.html 在浏览器打开
What is Expected?
点击确认按钮,事件生效
What is actually happening?
点击确认按钮,事件不生效