Vue ElementUI组件Notification使用自定义html,可触发点击事件
ElementUI组件Notification自定义HTMLcreateElement参考地址:https://www.cnblogs.com/vickylinj/p/9566474.htmlmethods: {notify() {this.$notify({title: '标题',position: 'right-bottom',dangerouslyUseHTMLString: true,me
·
ElementUI组件Notification自定义HTML
createElement参考地址:https://www.cnblogs.com/vickylinj/p/9566474.html
methods: {
notify() {
this.$notify({
title: '标题',
position: 'right-bottom',
dangerouslyUseHTMLString: true,
message: this.$createElement(
'div',
{},
[
this.$createElement('p', {}, [
this.$createElement('span', { style: { fontWeight: 'bold', color: 'red' } }, '点击触发vue函数:'),
this.$createElement('a',
{
class: 'send-elink-btn',
on: { click: this.test }
}, '点击调用test函数'),
this.$createElement('a',
{
class: 'send-elink-btn',
on: { click: () => {this.test('222')} }
}, '点击调用test函数带参数'),
]),
]
),
});
},
test(txt) {
console.log(txt)
}
}
更多推荐
已为社区贡献2条内容
所有评论(0)