methods:{open5(){this.$notify.info({title:'消息',message:'這是一條消息的提示消息'});}}這是餓了么UI的彈框方法,也是放到了單獨的一個pop.vue組件importpopfrom'@/components/pop'router.beforeEach((to,from,next)=>{if(to.path==='/login'||to.path==='/'){next()}else{if(Cookies.get('uName')){next()}else{next({path:'/login'})alert('請重新登錄')pop.methods.open5()//就是這里,使用報錯}}})這是router.js的守衛我想在重新登錄這使用open5這個方法,但是報錯,this不對
vue-router.js里如何使用餓了么組件的彈框等的方法
呼如林
2019-05-23 11:10:20