methods:{open5(){this.$notify.info({title:'消息',message:'這是一條消息的提示消息'});}}這是餓了么UI的彈框方法,也是放到了單獨(dú)的一個(gè)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('請(qǐng)重新登錄')pop.methods.open5()//就是這里,使用報(bào)錯(cuò)}}})這是router.js的守衛(wèi)我想在重新登錄這使用open5這個(gè)方法,但是報(bào)錯(cuò),this不對(duì)
vue-router.js里如何使用餓了么組件的彈框等的方法
函數(shù)式編程
2019-05-22 22:28:54