Created
November 29, 2019 03:41
-
-
Save yanwei07/9c2a0194723729a3eb2b565eb0b7134b to your computer and use it in GitHub Desktop.
vue router for mulitple page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vue from 'vue' | |
import Router from 'vue-router' | |
import Login from '@/components/Login' | |
import Docxso from '@/components/Docxso' | |
Vue.use(Router) | |
let router = new Router({ | |
routes: [ | |
{ | |
path: '*', | |
redirect: '/' | |
}, | |
{ | |
path: '/', | |
name: 'login', | |
component: Login | |
}, | |
{ | |
path: '/home', | |
name: 'home', | |
component: Docxso, | |
meta: { | |
requiresAuth: true | |
} | |
} | |
] | |
}) | |
export default router |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment