《ElementPlus 与 ElementUI 差异集合》el-popconfirm 气泡确认框之插槽写法有差异

ElementUI

  • 直接在 el-button 上配置属性 slot
html 复制代码
<el-popconfirm title="确定删除吗?请谨慎操作!" @confirm="delete">
	<el-button slot="reference" size="small" type="danger">删除</el-button>
</el-popconfirm>

elementPlus

  • 内嵌 <template #reference> 实现插槽机制;
html 复制代码
<el-popconfirm title="确定删除吗?请谨慎操作!" @confirm="delete">
	<template #reference>
		<el-button slot="reference" size="small" type="danger">删除</el-button>
	</template>
</el-popconfirm>

效果

相关推荐
大怪v12 小时前
AI抢饭?前端佬:我要验牌!
前端·人工智能·程序员
新酱爱学习12 小时前
字节外包一年,我的技术成长之路
前端·程序员·年终总结
小兵张健12 小时前
开源 playwright-pool 会话池来了
前端·javascript·github
IT_陈寒15 小时前
Python开发者必知的5大性能陷阱:90%的人都踩过的坑!
前端·人工智能·后端
codingWhat15 小时前
介绍一个手势识别库——AlloyFinger
前端·javascript·vue.js
Lee川15 小时前
深度拆解:基于面向对象思维的“就地编辑”组件全模块解析
javascript·架构
代码老中医15 小时前
2026年CSS彻底疯了:这6个新特性让我删掉了三分之一JS代码
前端
进击的尘埃15 小时前
Web Worker 与 OffscreenCanvas:把主线程从重活里解放出来
javascript
不会敲代码115 小时前
Zustand:轻量级状态管理,从入门到实践
前端·typescript
踩着两条虫15 小时前
VTJ.PRO 双向代码转换原理揭秘
前端·vue.js·人工智能