element-plus/docs/examples/popconfirm/trigger-event.vue
2021-12-04 11:20:06 +08:00

27 lines
540 B
Vue

<template>
<el-popconfirm
confirm-button-text="Yes"
cancel-button-text="No"
:icon="InfoFilled"
icon-color="red"
title="Are you sure to delete this?"
@confirm="confirmEvent"
@cancel="cancelEvent"
>
<template #reference>
<el-button>Delete</el-button>
</template>
</el-popconfirm>
</template>
<script setup lang="ts">
import { InfoFilled } from '@element-plus/icons-vue'
const confirmEvent = () => {
console.log('confirm!')
}
const cancelEvent = () => {
console.log('cancel!')
}
</script>