GConfirmButton 按钮
基础用法
所有属性都继承自element-plus ElPopconfirm
<template>
<g-confirm-button width="auto" @confirm="confirm" :btnConfig="{confirmText: '点我删除'}"></g-confirm-button>
</template>
<script setup lang="ts">
import { GConfirmButton } from 'gao-components-plus'
function confirm () {
return new Promise(resolve => {
setTimeout(() => {
resolve(true)
}, 3000);
})
}
</script>属性
| 名称 | 描述 | 类型 | 默认值 |
|---|---|---|---|
| btnConfig | 按钮配置 | GButtonProps | - |
btnConfig 属性
除GButtonProps外,支持一下属性
| 名称 | 描述 | 类型 | 默认值 |
|---|---|---|---|
| confirmText | 删除按钮显示的文字 | string | 删除 |
插槽
| 名称 | 描述 |
|---|---|
| default | 默认插槽 |
事件
| 名称 | 描述 |
|---|---|
| confirm | 点击确认按钮执行,若返回promise,删除按钮自动添加loading状态 |
