반응형
vue router
-
vue router프론트엔드/Vuejs 2020. 6. 14. 22:20
import Vue from 'vue' import Router from 'vue-router' import ExampleRouter from './modules/example' import Login from '@/components/common/Login' import store from '@/vuex/store' const requireAuth = () => (from, to, next) => { let auth = store.getters.getIsAuth if (auth) { return next() // isAuth === true면 페이지 이동 } next('/') // isAuth === false면 다시..