import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router);
const index = () => import('@views/bigScreen/index.vue');
export const router = new Router({
routes: [
{
path: '/',
name: 'bigScreen',
component: index
},
{
path: '/warehouseData',
name: 'warehouseData',
meta: {
title: '云仓运营服务质量报告'
} ,
component: () =>
import('@/views/bigScreen/warehouseData/index.vue'),
}
],
mode:'hash'
});
// 设置全局前置守卫
router.beforeEach((to, from, next) => {
// 设置页面标题
document.title = to.meta.title || '数字大屏';
next(); // 确保调用 next() 方法,否则路由不会改变
});
export default router;
网友评论