最近项目中要用到这个,所以练了练,因为文档中并没有过多的介绍,所以整理了一下
项目中推送消息 后跳转 目前找到两种方式(和群友讨论的)
第一种
openMessage(){
const
h =
this.
$createElement;
this.
instance=
this.
$notify({
title:
'异常',
message:
h(
'a',{
attrs:{
'href'
:
'https://www.baidu.com',}
},
'我是link'),
duration:
0,
})
},
第二种 跳转路由、
onClick(){
this.
$router.
push({
name:
'xxx',
params:{
"xxx"
:res}}) //你要跳转的路由 还可以传参 当然也可以通过其他方式跳转
},
openMessage(){
const
h =
this.
$createElement;
this.
instance=
this.
$notify({
title:
'异常',
message:
h(
'a',{
on:{
click:
this.
onClick
}
},
'我是link'),
duration:
0,
})
},
这只是本人的思考,若有错误,希望指出 ,谢谢