2025年6月9日10:23:02
This commit is contained in:
@@ -0,0 +1,90 @@
|
||||
import Vue from 'vue';
|
||||
import VueRouter from 'vue-router';
|
||||
|
||||
Vue.use(VueRouter);
|
||||
|
||||
const routes = [
|
||||
{
|
||||
path: '/userRanking',
|
||||
name: 'userRanking',
|
||||
meta: {
|
||||
title: '用户排名',
|
||||
rootValue: 108
|
||||
},
|
||||
component: () => import('@/views/userRanking/userRanking.vue')
|
||||
},
|
||||
{
|
||||
path: '/dietaryNutritionTips1',
|
||||
name: 'dietaryNutritionTips1',
|
||||
meta: {
|
||||
title: '膳食营养温馨提示',
|
||||
rootValue: 108
|
||||
},
|
||||
component: () => import('@/views/dietaryNutritionTips/dietaryNutritionTips1.vue')
|
||||
},
|
||||
{
|
||||
path: '/dietaryNutritionTips2',
|
||||
name: 'dietaryNutritionTips2',
|
||||
meta: {
|
||||
title: '膳食营养温馨提示',
|
||||
rootValue: 108
|
||||
},
|
||||
component: () => import('@/views/dietaryNutritionTips/dietaryNutritionTips2.vue')
|
||||
},
|
||||
{
|
||||
path: '/dataBoard',
|
||||
name: 'dataBoard',
|
||||
meta: {
|
||||
title: '数据看板',
|
||||
rootValue: 192
|
||||
},
|
||||
component: () => import('@/views/dataBoard/dataBoard.vue')
|
||||
},
|
||||
{
|
||||
path: '/dishesDetails',
|
||||
name: 'dishesDetails',
|
||||
meta: {
|
||||
title: '菜品详情',
|
||||
rootValue: 192
|
||||
},
|
||||
component: () => import('@/views/dishesDetails/dishesDetails.vue')
|
||||
},
|
||||
{
|
||||
path: '/mealSurplusInformation',
|
||||
name: 'mealSurplusInformation',
|
||||
meta: {
|
||||
title: '餐品余量信息',
|
||||
rootValue: 192
|
||||
},
|
||||
component: () => import('@/views/mealSurplusInformation/mealSurplusInformation.vue')
|
||||
},
|
||||
{
|
||||
path: '/led',
|
||||
name: 'led',
|
||||
meta: {
|
||||
title: 'led',
|
||||
rootValue: 192
|
||||
},
|
||||
component: () => import('@/views/led/led.vue')
|
||||
},
|
||||
{
|
||||
path: '/:catchAll(.*)',
|
||||
redirect: '/dietaryNutritionTips1'
|
||||
}
|
||||
];
|
||||
|
||||
const router = new VueRouter({
|
||||
// mode: 'history',
|
||||
base: process.env.BASE_URL,
|
||||
routes
|
||||
});
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
if (to.meta && to.meta.rootValue) {
|
||||
window.POSTCSS_PXTOREM_ROOT_VALUE = to.meta.rootValue;
|
||||
console.log(window.POSTCSS_PXTOREM_ROOT_VALUE);
|
||||
}
|
||||
next();
|
||||
});
|
||||
|
||||
export default router;
|
||||
Reference in New Issue
Block a user