当前位置:   article > 正文

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

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

ElementUI

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

elementPlus

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

效果
在这里插入图片描述

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/AllinToyou/article/detail/460353
推荐阅读
相关标签
  

闽ICP备14008679号