{ // 登錄 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()){}里面調(diào)用在vue里面的methods中創(chuàng)建的這個方法 getLocation() { return this.$store.dispatch("get", { uri: consts.PREFIX + "/city/open/location" });},該怎么實現(xiàn)
在后綴為js的文件里怎么調(diào)用后綴為vue文件中的methods中定義的方法
慕桂英3389331
2019-03-22 19:15:09