{
// 登录
path:'/login',
component: resolve => require(['@/app/Page/login/login.vue'], resolve),
meta: {title: '登录',wxAuth: true},
beforeEnter (to, from, next) {
if (auth.loggedIn()) {
next('/home')
} else {
next()
}
}
},
如上面是js文件中的一段代码,我想在if(auth.loggedIn()){}里面调用在vue里面的methods中创建的这个方法
getLocation() {
return this.$store.dispatch("get", {
uri: consts.PREFIX + "/city/open/location"
});
},
该怎么实现
繁花如伊
相关分类