element UI Notification通知上添加按钮和点击事件
element
A Vue.js 2.0 UI Toolkit for Web
项目地址:https://gitcode.com/gh_mirrors/eleme/element
免费下载资源
·
需求:消息通知的时候需要有更多的点击按钮,进行跳转
const h = this.$createElement;
const notify = this.$notify({
title: data.type,
message: h(
"p",
{
style:"width: 250px;display: flex;justify-content: space-between;",
},
[
h("span", null, data.content),
h(
"a",
{
style: "color: #409EFF;cursor: pointer;",
on: {
click: this.goToMore,
},
},
"更多"
),
]
),
position: "bottom-right",
type: "warning",
duration: 10000,
customClass: "custom-class",
});
this.notify[data.id] = notify;
添加button 和添加a标签一样
跳转的时候要将通知关闭
goToMore() {
let _this = this;
for (let key in _this.notify) {
_this.notify[key].close();
delete _this.notify[key];
} //关闭全部通知
this.$router.push("/earlyWarning/index");
},
GitHub 加速计划 / eleme / element
10
1
下载
A Vue.js 2.0 UI Toolkit for Web
最近提交(Master分支:5 个月前 )
c345bb45
9 个月前
a07f3a59
* Update transition.md
* Update table.md
* Update transition.md
* Update table.md
* Update transition.md
* Update table.md
* Update table.md
* Update transition.md
* Update popover.md 9 个月前
更多推荐
已为社区贡献2条内容
所有评论(0)