fix: 产品页面完善,增加空白布局与布局切换
This commit is contained in:
@@ -3,7 +3,7 @@ import { useNProgress } from '@vueuse/integrations/useNProgress';
|
||||
import { createRouter, createWebHistory } from 'vue-router';
|
||||
import { ROUTER_WHITE_LIST } from '@/config';
|
||||
import { errorRouter, layoutRouter, staticRouter } from '@/routers/modules/staticRouter';
|
||||
import { useUserStore } from '@/stores';
|
||||
import { useDesignStore, useUserStore } from '@/stores';
|
||||
|
||||
const { start, done } = useNProgress(0, {
|
||||
showSpinner: false,
|
||||
@@ -28,6 +28,8 @@ router.beforeEach(
|
||||
next: NavigationGuardNext,
|
||||
) => {
|
||||
const userStore = useUserStore();
|
||||
const designStore = useDesignStore(); // 必须在守卫内部调用
|
||||
designStore._setLayout(to.meta?.layout || 'vertical');
|
||||
|
||||
// 1、NProgress 开始
|
||||
start();
|
||||
|
||||
@@ -39,6 +39,7 @@ export const layoutRouter: RouteRecordRaw[] = [
|
||||
title: '产品页面',
|
||||
keepAlive: true, // 如果需要缓存
|
||||
isDefaultChat: false, // 根据实际情况设置
|
||||
layout: 'blankPage', // 如果需要自定义布局
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user