需求描述:
右上角有出来通知用户的有代办任务的消息框,点击消息框会跳转到代办路由页面。
getElementsByClassName() – 获取所有指定类名的元素
this.$notify({
title: 'XXX提醒',
message: '显示全局的通知提醒消息',
dangerouslyUseHTMLString: true,
customClass:"infoQtxl",
position: 'bottom-right',
duration: 10000
});
const infoQtxl=document.getElementsByClassName("infoQtxl")
infoQtxl[0].addEventListener("click", function(){
that.$router.push('/abcd');
console.log("目标元素被点击了");
});