You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
612 B
JavaScript
41 lines
612 B
JavaScript
import Vue from 'vue'
|
|
import Router from 'vue-router'
|
|
import Home from '@/views/Home'
|
|
import List from '@/views/List'
|
|
|
|
Vue.use(Router)
|
|
|
|
const routes = [
|
|
{
|
|
path: '/',
|
|
name: 'MyHome',
|
|
component: Home,
|
|
meta: {
|
|
title: '书架',
|
|
requireAuth: false,
|
|
}
|
|
},
|
|
{
|
|
path: '/list',
|
|
name: 'MyList',
|
|
component: List,
|
|
meta: {
|
|
title: '视频专栏',
|
|
requireAuth: false,
|
|
}
|
|
},
|
|
];
|
|
|
|
const router = new Router({
|
|
routes
|
|
});
|
|
|
|
router.beforeEach((to, from, next) => {
|
|
if (to.meta.title) {
|
|
document.title = to.meta.title
|
|
}
|
|
next();
|
|
})
|
|
|
|
export default router;
|