效果图
先在element js里按需引入 import {Notification,} from 'element-ui'
别直接Vue.use(Notification)
挂载到原型上 Vue.prototype.$notify = Notification
这个$notify就是咱们起的名字 叫abc都行 建议不动
然后在需要使用的地方设置就行了 如:
created() {
this.$notify({
title: "成功",
message: "获取左侧菜单列表成功",//这儿也可以用比如res.data.meta.msg的办法
type: "success",
});
},