docs(@vben/docs): update settings doc (#6128)
Co-authored-by: wyc001122 <wangyongchao@testor.com.cn>
This commit is contained in:
parent
e68fff58e8
commit
84ef207d9c
@ -60,6 +60,29 @@ VITE_INJECT_APP_LOADING=true
|
|||||||
VITE_ARCHIVER=true
|
VITE_ARCHIVER=true
|
||||||
```
|
```
|
||||||
|
|
||||||
|
```bash [.env.production]
|
||||||
|
# Public Path for Resources, must start and end with /
|
||||||
|
VITE_BASE=/
|
||||||
|
|
||||||
|
# API URL
|
||||||
|
VITE_GLOB_API_URL=https://mock-napi.vben.pro/api
|
||||||
|
|
||||||
|
# Whether to enable compression, can be set to none, brotli, gzip
|
||||||
|
VITE_COMPRESS=gzip
|
||||||
|
|
||||||
|
# Whether to enable PWA
|
||||||
|
VITE_PWA=false
|
||||||
|
|
||||||
|
# vue-router mode
|
||||||
|
VITE_ROUTER_HISTORY=hash
|
||||||
|
|
||||||
|
# Whether to inject global loading
|
||||||
|
VITE_INJECT_APP_LOADING=true
|
||||||
|
|
||||||
|
# Whether to generate dist.zip after packaging
|
||||||
|
VITE_ARCHIVER=true
|
||||||
|
```
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
## Dynamic Configuration in Production Environment
|
## Dynamic Configuration in Production Environment
|
||||||
@ -142,6 +165,7 @@ import { defineOverridesPreferences } from '@vben/preferences';
|
|||||||
/**
|
/**
|
||||||
* @description Project configuration file
|
* @description Project configuration file
|
||||||
* Only a part of the configuration in the project needs to be covered, and unnecessary configurations do not need to be covered. The default configuration will be automatically used
|
* Only a part of the configuration in the project needs to be covered, and unnecessary configurations do not need to be covered. The default configuration will be automatically used
|
||||||
|
* !!! Please clear the cache after changing the configuration, otherwise it may not take effect
|
||||||
*/
|
*/
|
||||||
export const overridesPreferences = defineOverridesPreferences({
|
export const overridesPreferences = defineOverridesPreferences({
|
||||||
// overrides
|
// overrides
|
||||||
@ -172,7 +196,7 @@ const defaultPreferences: Preferences = {
|
|||||||
isMobile: false,
|
isMobile: false,
|
||||||
layout: 'sidebar-nav',
|
layout: 'sidebar-nav',
|
||||||
locale: 'zh-CN',
|
locale: 'zh-CN',
|
||||||
loginExpiredMode: 'modal',
|
loginExpiredMode: 'page',
|
||||||
name: 'Vben Admin',
|
name: 'Vben Admin',
|
||||||
preferencesButtonPosition: 'auto',
|
preferencesButtonPosition: 'auto',
|
||||||
watermark: false,
|
watermark: false,
|
||||||
@ -191,14 +215,16 @@ const defaultPreferences: Preferences = {
|
|||||||
enable: true,
|
enable: true,
|
||||||
icp: '',
|
icp: '',
|
||||||
icpLink: '',
|
icpLink: '',
|
||||||
|
settingShow: true,
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
enable: true,
|
enable: false,
|
||||||
fixed: false,
|
fixed: false,
|
||||||
},
|
},
|
||||||
header: {
|
header: {
|
||||||
enable: true,
|
enable: true,
|
||||||
hidden: false,
|
hidden: false,
|
||||||
|
menuAlign: 'start',
|
||||||
mode: 'fixed',
|
mode: 'fixed',
|
||||||
},
|
},
|
||||||
logo: {
|
logo: {
|
||||||
@ -220,23 +246,28 @@ const defaultPreferences: Preferences = {
|
|||||||
sidebar: {
|
sidebar: {
|
||||||
autoActivateChild: false,
|
autoActivateChild: false,
|
||||||
collapsed: false,
|
collapsed: false,
|
||||||
|
collapsedButton: true,
|
||||||
collapsedShowTitle: false,
|
collapsedShowTitle: false,
|
||||||
enable: true,
|
enable: true,
|
||||||
expandOnHover: true,
|
expandOnHover: true,
|
||||||
extraCollapse: true,
|
extraCollapse: false,
|
||||||
|
fixedButton: true,
|
||||||
hidden: false,
|
hidden: false,
|
||||||
width: 230,
|
width: 224,
|
||||||
},
|
},
|
||||||
tabbar: {
|
tabbar: {
|
||||||
draggable: true,
|
draggable: true,
|
||||||
enable: true,
|
enable: true,
|
||||||
height: 36,
|
height: 38,
|
||||||
keepAlive: true,
|
keepAlive: true,
|
||||||
|
maxCount: 0,
|
||||||
|
middleClickToClose: false,
|
||||||
persist: true,
|
persist: true,
|
||||||
showIcon: true,
|
showIcon: true,
|
||||||
showMaximize: true,
|
showMaximize: true,
|
||||||
showMore: true,
|
showMore: true,
|
||||||
styleType: 'chrome',
|
styleType: 'chrome',
|
||||||
|
wheelable: true,
|
||||||
},
|
},
|
||||||
theme: {
|
theme: {
|
||||||
builtinType: 'default',
|
builtinType: 'default',
|
||||||
@ -247,7 +278,7 @@ const defaultPreferences: Preferences = {
|
|||||||
mode: 'dark',
|
mode: 'dark',
|
||||||
radius: '0.5',
|
radius: '0.5',
|
||||||
semiDarkHeader: false,
|
semiDarkHeader: false,
|
||||||
semiDarkSidebar: true,
|
semiDarkSidebar: false,
|
||||||
},
|
},
|
||||||
transition: {
|
transition: {
|
||||||
enable: true,
|
enable: true,
|
||||||
@ -261,9 +292,9 @@ const defaultPreferences: Preferences = {
|
|||||||
languageToggle: true,
|
languageToggle: true,
|
||||||
lockScreen: true,
|
lockScreen: true,
|
||||||
notification: true,
|
notification: true,
|
||||||
|
refresh: true,
|
||||||
sidebarToggle: true,
|
sidebarToggle: true,
|
||||||
themeToggle: true,
|
themeToggle: true,
|
||||||
refresh: true,
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
@ -345,6 +376,8 @@ interface CopyrightPreferences {
|
|||||||
icp: string;
|
icp: string;
|
||||||
/** Link to the ICP */
|
/** Link to the ICP */
|
||||||
icpLink: string;
|
icpLink: string;
|
||||||
|
/** Whether to show in settings panel */
|
||||||
|
settingShow?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface FooterPreferences {
|
interface FooterPreferences {
|
||||||
@ -359,6 +392,8 @@ interface HeaderPreferences {
|
|||||||
enable: boolean;
|
enable: boolean;
|
||||||
/** Whether the header is hidden, css-hidden */
|
/** Whether the header is hidden, css-hidden */
|
||||||
hidden: boolean;
|
hidden: boolean;
|
||||||
|
/** Header menu alignment */
|
||||||
|
menuAlign: LayoutHeaderMenuAlignType;
|
||||||
/** Header display mode */
|
/** Header display mode */
|
||||||
mode: LayoutHeaderModeType;
|
mode: LayoutHeaderModeType;
|
||||||
}
|
}
|
||||||
@ -379,8 +414,12 @@ interface NavigationPreferences {
|
|||||||
styleType: NavigationStyleType;
|
styleType: NavigationStyleType;
|
||||||
}
|
}
|
||||||
interface SidebarPreferences {
|
interface SidebarPreferences {
|
||||||
|
/** Automatically activate child menu when clicking on directory */
|
||||||
|
autoActivateChild: boolean;
|
||||||
/** Whether the sidebar is collapsed */
|
/** Whether the sidebar is collapsed */
|
||||||
collapsed: boolean;
|
collapsed: boolean;
|
||||||
|
/** Whether the sidebar collapse button is visible */
|
||||||
|
collapsedButton: boolean;
|
||||||
/** Whether to show title when sidebar is collapsed */
|
/** Whether to show title when sidebar is collapsed */
|
||||||
collapsedShowTitle: boolean;
|
collapsedShowTitle: boolean;
|
||||||
/** Whether the sidebar is visible */
|
/** Whether the sidebar is visible */
|
||||||
@ -389,6 +428,8 @@ interface SidebarPreferences {
|
|||||||
expandOnHover: boolean;
|
expandOnHover: boolean;
|
||||||
/** Whether the sidebar extension area is collapsed */
|
/** Whether the sidebar extension area is collapsed */
|
||||||
extraCollapse: boolean;
|
extraCollapse: boolean;
|
||||||
|
/** Whether the sidebar fixed button is visible */
|
||||||
|
fixedButton: boolean;
|
||||||
/** Whether the sidebar is hidden - css */
|
/** Whether the sidebar is hidden - css */
|
||||||
hidden: boolean;
|
hidden: boolean;
|
||||||
/** Sidebar width */
|
/** Sidebar width */
|
||||||
@ -417,6 +458,10 @@ interface TabbarPreferences {
|
|||||||
height: number;
|
height: number;
|
||||||
/** Whether tab caching is enabled */
|
/** Whether tab caching is enabled */
|
||||||
keepAlive: boolean;
|
keepAlive: boolean;
|
||||||
|
/** Maximum number of tabs */
|
||||||
|
maxCount: number;
|
||||||
|
/** Whether to close tab when middle-clicked */
|
||||||
|
middleClickToClose: boolean;
|
||||||
/** Whether tabs are persistent */
|
/** Whether tabs are persistent */
|
||||||
persist: boolean;
|
persist: boolean;
|
||||||
/** Whether icons in multiple tabs are enabled */
|
/** Whether icons in multiple tabs are enabled */
|
||||||
@ -427,6 +472,8 @@ interface TabbarPreferences {
|
|||||||
showMore: boolean;
|
showMore: boolean;
|
||||||
/** Tab style */
|
/** Tab style */
|
||||||
styleType: TabsStyleType;
|
styleType: TabsStyleType;
|
||||||
|
/** Whether mouse wheel response is enabled */
|
||||||
|
wheelable: boolean;
|
||||||
}
|
}
|
||||||
interface ThemePreferences {
|
interface ThemePreferences {
|
||||||
/** Built-in theme name */
|
/** Built-in theme name */
|
||||||
@ -514,5 +561,6 @@ interface Preferences {
|
|||||||
|
|
||||||
- The `overridesPreferences` method only needs to override a part of the configurations in the project. There's no need to override configurations that are not needed; they will automatically use the default settings.
|
- The `overridesPreferences` method only needs to override a part of the configurations in the project. There's no need to override configurations that are not needed; they will automatically use the default settings.
|
||||||
- Any configuration item can be overridden. You just need to override it within the `overridesPreferences` method. Do not modify the default configuration file.
|
- Any configuration item can be overridden. You just need to override it within the `overridesPreferences` method. Do not modify the default configuration file.
|
||||||
|
- Please clear the cache after changing the configuration, otherwise it may not take effect.
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
@ -195,7 +195,7 @@ const defaultPreferences: Preferences = {
|
|||||||
isMobile: false,
|
isMobile: false,
|
||||||
layout: 'sidebar-nav',
|
layout: 'sidebar-nav',
|
||||||
locale: 'zh-CN',
|
locale: 'zh-CN',
|
||||||
loginExpiredMode: 'modal',
|
loginExpiredMode: 'page',
|
||||||
name: 'Vben Admin',
|
name: 'Vben Admin',
|
||||||
preferencesButtonPosition: 'auto',
|
preferencesButtonPosition: 'auto',
|
||||||
watermark: false,
|
watermark: false,
|
||||||
@ -214,14 +214,16 @@ const defaultPreferences: Preferences = {
|
|||||||
enable: true,
|
enable: true,
|
||||||
icp: '',
|
icp: '',
|
||||||
icpLink: '',
|
icpLink: '',
|
||||||
|
settingShow: true,
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
enable: true,
|
enable: false,
|
||||||
fixed: false,
|
fixed: false,
|
||||||
},
|
},
|
||||||
header: {
|
header: {
|
||||||
enable: true,
|
enable: true,
|
||||||
hidden: false,
|
hidden: false,
|
||||||
|
menuAlign: 'start',
|
||||||
mode: 'fixed',
|
mode: 'fixed',
|
||||||
},
|
},
|
||||||
logo: {
|
logo: {
|
||||||
@ -243,23 +245,28 @@ const defaultPreferences: Preferences = {
|
|||||||
sidebar: {
|
sidebar: {
|
||||||
autoActivateChild: false,
|
autoActivateChild: false,
|
||||||
collapsed: false,
|
collapsed: false,
|
||||||
|
collapsedButton: true,
|
||||||
collapsedShowTitle: false,
|
collapsedShowTitle: false,
|
||||||
enable: true,
|
enable: true,
|
||||||
expandOnHover: true,
|
expandOnHover: true,
|
||||||
extraCollapse: true,
|
extraCollapse: false,
|
||||||
|
fixedButton: true,
|
||||||
hidden: false,
|
hidden: false,
|
||||||
width: 230,
|
width: 224,
|
||||||
},
|
},
|
||||||
tabbar: {
|
tabbar: {
|
||||||
draggable: true,
|
draggable: true,
|
||||||
enable: true,
|
enable: true,
|
||||||
height: 36,
|
height: 38,
|
||||||
keepAlive: true,
|
keepAlive: true,
|
||||||
|
maxCount: 0,
|
||||||
|
middleClickToClose: false,
|
||||||
persist: true,
|
persist: true,
|
||||||
showIcon: true,
|
showIcon: true,
|
||||||
showMaximize: true,
|
showMaximize: true,
|
||||||
showMore: true,
|
showMore: true,
|
||||||
styleType: 'chrome',
|
styleType: 'chrome',
|
||||||
|
wheelable: true,
|
||||||
},
|
},
|
||||||
theme: {
|
theme: {
|
||||||
builtinType: 'default',
|
builtinType: 'default',
|
||||||
@ -270,7 +277,7 @@ const defaultPreferences: Preferences = {
|
|||||||
mode: 'dark',
|
mode: 'dark',
|
||||||
radius: '0.5',
|
radius: '0.5',
|
||||||
semiDarkHeader: false,
|
semiDarkHeader: false,
|
||||||
semiDarkSidebar: true,
|
semiDarkSidebar: false,
|
||||||
},
|
},
|
||||||
transition: {
|
transition: {
|
||||||
enable: true,
|
enable: true,
|
||||||
@ -369,6 +376,8 @@ interface CopyrightPreferences {
|
|||||||
icp: string;
|
icp: string;
|
||||||
/** 备案号链接 */
|
/** 备案号链接 */
|
||||||
icpLink: string;
|
icpLink: string;
|
||||||
|
/** 设置面板是否显示*/
|
||||||
|
settingShow?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface FooterPreferences {
|
interface FooterPreferences {
|
||||||
@ -383,6 +392,8 @@ interface HeaderPreferences {
|
|||||||
enable: boolean;
|
enable: boolean;
|
||||||
/** 顶栏是否隐藏,css-隐藏 */
|
/** 顶栏是否隐藏,css-隐藏 */
|
||||||
hidden: boolean;
|
hidden: boolean;
|
||||||
|
/** 顶栏菜单位置 */
|
||||||
|
menuAlign: LayoutHeaderMenuAlignType;
|
||||||
/** header显示模式 */
|
/** header显示模式 */
|
||||||
mode: LayoutHeaderModeType;
|
mode: LayoutHeaderModeType;
|
||||||
}
|
}
|
||||||
@ -404,8 +415,12 @@ interface NavigationPreferences {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface SidebarPreferences {
|
interface SidebarPreferences {
|
||||||
|
/** 点击目录时自动激活子菜单 */
|
||||||
|
autoActivateChild: boolean;
|
||||||
/** 侧边栏是否折叠 */
|
/** 侧边栏是否折叠 */
|
||||||
collapsed: boolean;
|
collapsed: boolean;
|
||||||
|
/** 侧边栏折叠按钮是否可见 */
|
||||||
|
collapsedButton: boolean;
|
||||||
/** 侧边栏折叠时,是否显示title */
|
/** 侧边栏折叠时,是否显示title */
|
||||||
collapsedShowTitle: boolean;
|
collapsedShowTitle: boolean;
|
||||||
/** 侧边栏是否可见 */
|
/** 侧边栏是否可见 */
|
||||||
@ -414,6 +429,8 @@ interface SidebarPreferences {
|
|||||||
expandOnHover: boolean;
|
expandOnHover: boolean;
|
||||||
/** 侧边栏扩展区域是否折叠 */
|
/** 侧边栏扩展区域是否折叠 */
|
||||||
extraCollapse: boolean;
|
extraCollapse: boolean;
|
||||||
|
/** 侧边栏固定按钮是否可见 */
|
||||||
|
fixedButton: boolean;
|
||||||
/** 侧边栏是否隐藏 - css */
|
/** 侧边栏是否隐藏 - css */
|
||||||
hidden: boolean;
|
hidden: boolean;
|
||||||
/** 侧边栏宽度 */
|
/** 侧边栏宽度 */
|
||||||
@ -442,6 +459,10 @@ interface TabbarPreferences {
|
|||||||
height: number;
|
height: number;
|
||||||
/** 开启标签页缓存功能 */
|
/** 开启标签页缓存功能 */
|
||||||
keepAlive: boolean;
|
keepAlive: boolean;
|
||||||
|
/** 限制最大数量 */
|
||||||
|
maxCount: number;
|
||||||
|
/** 是否点击中键时关闭标签 */
|
||||||
|
middleClickToClose: boolean;
|
||||||
/** 是否持久化标签 */
|
/** 是否持久化标签 */
|
||||||
persist: boolean;
|
persist: boolean;
|
||||||
/** 是否开启多标签页图标 */
|
/** 是否开启多标签页图标 */
|
||||||
@ -452,6 +473,8 @@ interface TabbarPreferences {
|
|||||||
showMore: boolean;
|
showMore: boolean;
|
||||||
/** 标签页风格 */
|
/** 标签页风格 */
|
||||||
styleType: TabsStyleType;
|
styleType: TabsStyleType;
|
||||||
|
/** 是否开启鼠标滚轮响应 */
|
||||||
|
wheelable: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ThemePreferences {
|
interface ThemePreferences {
|
||||||
|
Loading…
Reference in New Issue
Block a user