mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-06-08 01:17:23 +08:00
feat: 支持后端传component组件路径
This commit is contained in:
parent
0becf0b4bc
commit
5828ad55a1
@ -266,6 +266,7 @@ function setLayoutThemeColor(theme: string) {
|
|||||||
|
|
||||||
// 设置ep主题色
|
// 设置ep主题色
|
||||||
const setEpThemeColor = (color: string) => {
|
const setEpThemeColor = (color: string) => {
|
||||||
|
// @ts-expect-error
|
||||||
writeNewStyle(createNewStyle(color));
|
writeNewStyle(createNewStyle(color));
|
||||||
useEpThemeStoreHook().setEpThemeColor(color);
|
useEpThemeStoreHook().setEpThemeColor(color);
|
||||||
body.style.setProperty("--el-color-primary-active", shadeBgColor(color));
|
body.style.setProperty("--el-color-primary-active", shadeBgColor(color));
|
||||||
@ -298,7 +299,7 @@ nextTick(() => {
|
|||||||
settings.weakVal &&
|
settings.weakVal &&
|
||||||
document.querySelector("html")?.setAttribute("class", "html-weakness");
|
document.querySelector("html")?.setAttribute("class", "html-weakness");
|
||||||
settings.tabsVal && tagsChange();
|
settings.tabsVal && tagsChange();
|
||||||
|
// @ts-expect-error
|
||||||
writeNewStyle(createNewStyle(epThemeColor.value));
|
writeNewStyle(createNewStyle(epThemeColor.value));
|
||||||
dataThemeChange();
|
dataThemeChange();
|
||||||
});
|
});
|
||||||
|
@ -46,13 +46,6 @@ watch(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
watch(
|
|
||||||
() => route.path,
|
|
||||||
() => {
|
|
||||||
menuSelect(route.path, routers);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
function translationCh() {
|
function translationCh() {
|
||||||
instance.locale = { locale: "zh" };
|
instance.locale = { locale: "zh" };
|
||||||
locale.value = "zh";
|
locale.value = "zh";
|
||||||
|
@ -51,7 +51,6 @@ watch(
|
|||||||
() => route.path,
|
() => route.path,
|
||||||
() => {
|
() => {
|
||||||
getSubMenuData(route.path);
|
getSubMenuData(route.path);
|
||||||
menuSelect(route.path, routers);
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
</script>
|
</script>
|
||||||
|
@ -234,7 +234,11 @@ function addAsyncRoutes(arrRoutes: Array<RouteRecordRaw>) {
|
|||||||
} else if (v.meta?.frameSrc) {
|
} else if (v.meta?.frameSrc) {
|
||||||
v.component = IFrame;
|
v.component = IFrame;
|
||||||
} else {
|
} else {
|
||||||
const index = modulesRoutesKeys.findIndex(ev => ev.includes(v.path));
|
// 对后端传component组件路径和不传做兼容(如果后端传component组件路径,那么path可以随便写,如果不传,component组件路径会根path保持一致)
|
||||||
|
const index = v?.component
|
||||||
|
? // @ts-expect-error
|
||||||
|
modulesRoutesKeys.findIndex(ev => ev.includes(v.component))
|
||||||
|
: modulesRoutesKeys.findIndex(ev => ev.includes(v.path));
|
||||||
v.component = modulesRoutes[modulesRoutesKeys[index]];
|
v.component = modulesRoutes[modulesRoutesKeys[index]];
|
||||||
}
|
}
|
||||||
if (v.children) {
|
if (v.children) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user