mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-11-03 13:44:47 +08:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
88bba7555b | ||
|
|
30c682bd24 | ||
|
|
3baffa11e4 | ||
|
|
1ed598c5f2 | ||
|
|
185d779c8d | ||
|
|
241fc618b8 |
@@ -1,3 +1,17 @@
|
|||||||
|
# 3.4.6 (2022-8-23)
|
||||||
|
|
||||||
|
### 🐞 Bug fixes
|
||||||
|
|
||||||
|
- `process` is not defined in path
|
||||||
|
- Fixed an error when dynamic routing `children` is an empty array
|
||||||
|
- Fixed `iframe` loading failure
|
||||||
|
|
||||||
|
# 3.4.5 (2022-8-22)
|
||||||
|
|
||||||
|
### 🐞 Bug fixes
|
||||||
|
|
||||||
|
- Fix local responsive storage object setting issue
|
||||||
|
|
||||||
# 3.4.0 (2022-8-22)
|
# 3.4.0 (2022-8-22)
|
||||||
|
|
||||||
### 🍏 Perf
|
### 🍏 Perf
|
||||||
|
|||||||
14
CHANGELOG.md
14
CHANGELOG.md
@@ -1,3 +1,17 @@
|
|||||||
|
# 3.4.6 (2022-8-23)
|
||||||
|
|
||||||
|
### 🐞 Bug fixes
|
||||||
|
|
||||||
|
- `process` is not defined in path
|
||||||
|
- Fixed an error when dynamic routing `children` is an empty array
|
||||||
|
- Fixed `iframe` loading failure
|
||||||
|
|
||||||
|
# 3.4.5 (2022-8-22)
|
||||||
|
|
||||||
|
### 🐞 Bug fixes
|
||||||
|
|
||||||
|
- Fix local responsive storage object setting issue
|
||||||
|
|
||||||
# 3.4.0 (2022-8-22)
|
# 3.4.0 (2022-8-22)
|
||||||
|
|
||||||
### 🍏 Perf
|
### 🍏 Perf
|
||||||
|
|||||||
@@ -1,3 +1,17 @@
|
|||||||
|
# 3.4.6 (2022-8-23)
|
||||||
|
|
||||||
|
### 🐞 Bug fixes
|
||||||
|
|
||||||
|
- `process` is not defined in path
|
||||||
|
- 修复动态路由`children`为空数组时报错
|
||||||
|
- 修复`iframe`加载失败
|
||||||
|
|
||||||
|
# 3.4.5 (2022-8-22)
|
||||||
|
|
||||||
|
### 🐞 Bug fixes
|
||||||
|
|
||||||
|
- 修复本地响应式存储对象设置问题
|
||||||
|
|
||||||
# 3.4.0 (2022-8-22)
|
# 3.4.0 (2022-8-22)
|
||||||
|
|
||||||
### 🍏 Perf
|
### 🍏 Perf
|
||||||
|
|||||||
@@ -10,9 +10,6 @@
|
|||||||
/>
|
/>
|
||||||
<title>vue-pure-admin</title>
|
<title>vue-pure-admin</title>
|
||||||
<link rel="icon" href="/favicon.ico" />
|
<link rel="icon" href="/favicon.ico" />
|
||||||
<script>
|
|
||||||
window.process = {};
|
|
||||||
</script>
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "vue-pure-admin",
|
"name": "vue-pure-admin",
|
||||||
"version": "3.4.0",
|
"version": "3.4.6",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "cross-env --max_old_space_size=4096 vite",
|
"dev": "cross-env --max_old_space_size=4096 vite",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"Version": "3.4.0",
|
"Version": "3.4.6",
|
||||||
"Title": "PureAdmin",
|
"Title": "PureAdmin",
|
||||||
"FixedHeader": true,
|
"FixedHeader": true,
|
||||||
"HiddenSideBar": false,
|
"HiddenSideBar": false,
|
||||||
|
|||||||
@@ -211,8 +211,9 @@ function setLayoutModel(layout: string) {
|
|||||||
$storage.layout = {
|
$storage.layout = {
|
||||||
layout,
|
layout,
|
||||||
theme: layoutTheme.value.theme,
|
theme: layoutTheme.value.theme,
|
||||||
darkMode: $storage.layout.darkMode,
|
darkMode: $storage.layout?.darkMode,
|
||||||
sidebarStatus: $storage.layout.sidebarStatus
|
sidebarStatus: $storage.layout?.sidebarStatus,
|
||||||
|
epThemeColor: $storage.layout?.epThemeColor
|
||||||
};
|
};
|
||||||
useAppStoreHook().setLayout(layout);
|
useAppStoreHook().setLayout(layout);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import {
|
|||||||
} from "@pureadmin/theme/dist/browser-utils";
|
} from "@pureadmin/theme/dist/browser-utils";
|
||||||
|
|
||||||
export function useDataThemeChange() {
|
export function useDataThemeChange() {
|
||||||
const { layoutTheme } = useLayout();
|
const { layoutTheme, layout } = useLayout();
|
||||||
const themeColors = ref<Array<themeColorsType>>([
|
const themeColors = ref<Array<themeColorsType>>([
|
||||||
/* 道奇蓝(默认) */
|
/* 道奇蓝(默认) */
|
||||||
{ color: "#1b2a47", themeColor: "default" },
|
{ color: "#1b2a47", themeColor: "default" },
|
||||||
@@ -36,7 +36,7 @@ export function useDataThemeChange() {
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
const { $storage } = useGlobal<GlobalPropertiesApi>();
|
const { $storage } = useGlobal<GlobalPropertiesApi>();
|
||||||
|
const dataTheme = ref<boolean>($storage?.layout?.darkMode);
|
||||||
const body = document.documentElement as HTMLElement;
|
const body = document.documentElement as HTMLElement;
|
||||||
|
|
||||||
/** 设置导航主题色 */
|
/** 设置导航主题色 */
|
||||||
@@ -45,8 +45,13 @@ export function useDataThemeChange() {
|
|||||||
toggleTheme({
|
toggleTheme({
|
||||||
scopeName: `layout-theme-${theme}`
|
scopeName: `layout-theme-${theme}`
|
||||||
});
|
});
|
||||||
$storage.layout.theme = theme;
|
$storage.layout = {
|
||||||
$storage.layout.darkMode = dataTheme.value;
|
layout: layout.value,
|
||||||
|
theme,
|
||||||
|
darkMode: dataTheme.value,
|
||||||
|
sidebarStatus: $storage.layout?.sidebarStatus,
|
||||||
|
epThemeColor: $storage.layout?.epThemeColor
|
||||||
|
};
|
||||||
|
|
||||||
if (theme === "default" || theme === "light") {
|
if (theme === "default" || theme === "light") {
|
||||||
setEpThemeColor(getConfig().EpThemeColor);
|
setEpThemeColor(getConfig().EpThemeColor);
|
||||||
@@ -82,7 +87,6 @@ export function useDataThemeChange() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const dataTheme = ref<boolean>($storage?.layout?.darkMode);
|
|
||||||
|
|
||||||
/** 日间、夜间主题切换 */
|
/** 日间、夜间主题切换 */
|
||||||
function dataThemeChange() {
|
function dataThemeChange() {
|
||||||
@@ -94,10 +98,8 @@ export function useDataThemeChange() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (dataTheme.value) {
|
if (dataTheme.value) {
|
||||||
$storage.layout.darkMode = true;
|
|
||||||
document.documentElement.classList.add("dark");
|
document.documentElement.classList.add("dark");
|
||||||
} else {
|
} else {
|
||||||
$storage.layout.darkMode = false;
|
|
||||||
document.documentElement.classList.remove("dark");
|
document.documentElement.classList.remove("dark");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -230,16 +230,21 @@ function addAsyncRoutes(arrRoutes: Array<RouteRecordRaw>) {
|
|||||||
// 将backstage属性加入meta,标识此路由为后端返回路由
|
// 将backstage属性加入meta,标识此路由为后端返回路由
|
||||||
v.meta.backstage = true;
|
v.meta.backstage = true;
|
||||||
// 父级的redirect属性取值:如果子级存在且父级的redirect属性不存在,默认取第一个子级的path;如果子级存在且父级的redirect属性存在,取存在的redirect属性,会覆盖默认值
|
// 父级的redirect属性取值:如果子级存在且父级的redirect属性不存在,默认取第一个子级的path;如果子级存在且父级的redirect属性存在,取存在的redirect属性,会覆盖默认值
|
||||||
if (v?.children && !v.redirect) v.redirect = v.children[0].path;
|
if (v?.children && v.children.length && !v.redirect)
|
||||||
|
v.redirect = v.children[0].path;
|
||||||
// 父级的name属性取值:如果子级存在且父级的name属性不存在,默认取第一个子级的name;如果子级存在且父级的name属性存在,取存在的name属性,会覆盖默认值
|
// 父级的name属性取值:如果子级存在且父级的name属性不存在,默认取第一个子级的name;如果子级存在且父级的name属性存在,取存在的name属性,会覆盖默认值
|
||||||
if (v?.children && !v.name) v.name = v.children[0].name;
|
if (v?.children && v.children.length && !v.name)
|
||||||
if (v.meta?.frameSrc) v.component = IFrame;
|
v.name = v.children[0].name;
|
||||||
// 对后端传component组件路径和不传做兼容(如果后端传component组件路径,那么path可以随便写,如果不传,component组件路径会跟path保持一致)
|
if (v.meta?.frameSrc) {
|
||||||
const index = v?.component
|
v.component = IFrame;
|
||||||
? modulesRoutesKeys.findIndex(ev => ev.includes(v.component as any))
|
} else {
|
||||||
: modulesRoutesKeys.findIndex(ev => ev.includes(v.path));
|
// 对后端传component组件路径和不传做兼容(如果后端传component组件路径,那么path可以随便写,如果不传,component组件路径会跟path保持一致)
|
||||||
v.component = modulesRoutes[modulesRoutesKeys[index]];
|
const index = v?.component
|
||||||
if (v.children) {
|
? modulesRoutesKeys.findIndex(ev => ev.includes(v.component as any))
|
||||||
|
: modulesRoutesKeys.findIndex(ev => ev.includes(v.path));
|
||||||
|
v.component = modulesRoutes[modulesRoutesKeys[index]];
|
||||||
|
}
|
||||||
|
if (v?.children && v.children.length) {
|
||||||
addAsyncRoutes(v.children);
|
addAsyncRoutes(v.children);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -70,6 +70,8 @@ export default ({ command, mode }: ConfigEnv): UserConfigExport => {
|
|||||||
chunkSizeWarningLimit: 4000
|
chunkSizeWarningLimit: 4000
|
||||||
},
|
},
|
||||||
define: {
|
define: {
|
||||||
|
"process.platform": null,
|
||||||
|
"process.version": null,
|
||||||
__INTLIFY_PROD_DEVTOOLS__: false,
|
__INTLIFY_PROD_DEVTOOLS__: false,
|
||||||
__APP_INFO__: JSON.stringify(__APP_INFO__)
|
__APP_INFO__: JSON.stringify(__APP_INFO__)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user