1. jsx语法中使用插槽
以elementplus ElPopconfirm 为例
javascript
<el-popconfirm title="Are you sure to delete this?">
<template #reference>
<el-button>Delete</el-button>
</template>
</el-popconfirm>
使用
javascript
slots: {
default: (data: any) => {
const slot = {
reference: () => (
<div>{1111}</div>
)
}
return (
<>
<ElPopconfirm title="Are you sure to delete this?" v-slots={slot}></ElPopconfirm>
</>
)
}
}