mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-26 09:11:52 +08:00
perf: 路由子集显示可配置
This commit is contained in:
parent
ec0bb01e07
commit
1ef6016d9d
@ -12,3 +12,6 @@ VITE_APP_TENANT_ENABLE=true
|
|||||||
|
|
||||||
# 验证码的开关
|
# 验证码的开关
|
||||||
VITE_APP_CAPTCHA_ENABLE=true
|
VITE_APP_CAPTCHA_ENABLE=true
|
||||||
|
|
||||||
|
# 路由在只有一个子集的时候是否显示父级
|
||||||
|
VITE_ROUTE_ALWAYSSHOW_ENABLE=true
|
||||||
|
@ -57,7 +57,12 @@ export const generateRoute = (routes: AppCustomRouteRecordRaw[]): AppRouteRecord
|
|||||||
icon: route.icon,
|
icon: route.icon,
|
||||||
hidden: !route.visible,
|
hidden: !route.visible,
|
||||||
noCache: !route.keepAlive,
|
noCache: !route.keepAlive,
|
||||||
alwaysShow: route.children && route.children.length == 1 ? true : false
|
alwaysShow:
|
||||||
|
route.children &&
|
||||||
|
route.children.length === 1 &&
|
||||||
|
import.meta.env.VITE_ROUTE_ALWAYSSHOW_ENABLE === 'true'
|
||||||
|
? true
|
||||||
|
: false
|
||||||
}
|
}
|
||||||
// 路由地址转首字母大写驼峰,作为路由名称,适配keepAlive
|
// 路由地址转首字母大写驼峰,作为路由名称,适配keepAlive
|
||||||
let data: AppRouteRecordRaw = {
|
let data: AppRouteRecordRaw = {
|
||||||
|
3
yudao-ui-admin-vue3/types/env.d.ts
vendored
3
yudao-ui-admin-vue3/types/env.d.ts
vendored
@ -10,7 +10,8 @@ declare module '*.vue' {
|
|||||||
interface ImportMetaEnv {
|
interface ImportMetaEnv {
|
||||||
readonly VITE_APP_TITLE: string
|
readonly VITE_APP_TITLE: string
|
||||||
readonly VITE_PORT: number
|
readonly VITE_PORT: number
|
||||||
readonly VITE_OPEN: boolean
|
readonly VITE_OPEN: string
|
||||||
|
readonly VITE_ROUTE_ALWAYSSHOW_ENABLE: string
|
||||||
readonly VITE_APP_CAPTCHA_ENABLE: string
|
readonly VITE_APP_CAPTCHA_ENABLE: string
|
||||||
readonly VITE_APP_TENANT_ENABLE: string
|
readonly VITE_APP_TENANT_ENABLE: string
|
||||||
readonly VITE_BASE_URL: string
|
readonly VITE_BASE_URL: string
|
||||||
|
@ -30,7 +30,7 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
|
|||||||
// 端口号
|
// 端口号
|
||||||
port: env.VITE_PORT,
|
port: env.VITE_PORT,
|
||||||
host: "0.0.0.0",
|
host: "0.0.0.0",
|
||||||
open: env.VITE_OPEN,
|
open: env.VITE_OPEN === 'true',
|
||||||
// 本地跨域代理
|
// 本地跨域代理
|
||||||
proxy: {
|
proxy: {
|
||||||
['/admin-api']: {
|
['/admin-api']: {
|
||||||
|
Loading…
Reference in New Issue
Block a user