const notify = ref({})
const fc = () =>{
const num = Math.random()
notify.value[num] = ElNotification({
type: 'warning',
title: '提醒',
message: '123',
duration: false,
dangerouslyUseHTMLString: true,
message: h('div', [
h(
"p",
{},
'消息',
),
h(
"p",
{
style: "width: 250px;display: flex;justify-content: space-between;",
},
[
h(
"a",
{
style: "color: #409EFF;cursor: pointer;",
onClick: goClose,
id: num
},
"确定"
),
]
)]
)
})
}
const goClose = () => {
notify.value[num.target.id].close()
}
vue3 ElNotification 添加自定义按钮和事件
于 2024-02-22 10:18:05 首次发布