赞
踩
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)
- }
- }
赞
踩
赞
踩
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。