ant-design Popconfirm的使用

这个就是需要的popcofrim

  <Popconfirm
                        title="确定删除么"
                        onConfirm={() => {
                            confirm(record.id);
                        }}
                        onCancel={cancel}
                        okText="确定"
                        cancelText="取消"
                    >
                    <a>Delete</a>
                    </Popconfirm>

 

在 Vue3 后台项目中使用 Arco Design Vue 的气泡框 Popconfirm,有以下几种使用方式: 1. 基本用法: ```vue <template> <div> <a-popconfirm title="确定要删除吗?" @confirm="handleDelete"> <a-button>Delete</a-button> </a-popconfirm> </div> </template> <script> import { defineComponent } from 'vue'; import { Popconfirm, Button } from '@arco-design/web-vue'; export default defineComponent({ components: { Popconfirm, Button }, methods: { handleDelete() { // 处理删除逻辑 }, }, }); </script> ``` 2. 自定义触发元素: ```vue <template> <div> <a-popconfirm title="确定要删除吗?" trigger-slot> <a-button slot="trigger">Delete</a-button> <template #content> <p>确定要删除吗?</p> <a-button type="primary" size="small" @click="handleDelete">确定</a-button> <a-button size="small">取消</a-button> </template> </a-popconfirm> </div> </template> <script> import { defineComponent } from 'vue'; import { Popconfirm, Button } from '@arco-design/web-vue'; export default defineComponent({ components: { Popconfirm, Button }, methods: { handleDelete() { // 处理删除逻辑 }, }, }); </script> ``` 3. 控制弹出框的显示和隐藏: ```vue <template> <div> <a-button @click="visible = true">Open</a-button> <a-popconfirm title="确定要删除吗?" v-model:visible="visible"> <template #content> <p>确定要删除吗?</p> <a-button type="primary" size="small" @click="handleDelete">确定</a-button> <a-button size="small" @click="visible = false">取消</a-button> </template> </a-popconfirm> </div> </template> <script> import { defineComponent, ref } from 'vue'; import { Popconfirm, Button } from '@arco-design/web-vue'; export default defineComponent({ components: { Popconfirm, Button }, setup() { const visible = ref(false); const handleDelete = () => { // 处理删除逻辑 visible.value = false; }; return { visible, handleDelete, }; }, }); </script> ``` 4. 自定义样式: 可以通过 `style` 和 `class` 属性来自定义气泡框和触发元素的样式。 以上就是在 Vue3 后台项目中使用 Arco Design Vue 的气泡框 Popconfirm 的几种使用方式。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

reg183

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值