wip(Layout): Layout developing

This commit is contained in:
陈凯龙
2022-01-13 17:26:06 +08:00
parent 66e8d0e41c
commit 2fe9543b84
27 changed files with 282 additions and 35 deletions

View File

@@ -149,7 +149,3 @@ function subtractLight(color: string, amount: number) {
const c = cc < 0 ? 0 : cc
return c.toString(16).length > 1 ? c.toString(16) : `0${c.toString(16)}`
}
export function setCssVar(prop: string, val: any, dom = document.documentElement) {
dom.style.setProperty(prop, val)
}

View File

@@ -34,3 +34,7 @@ export function underlineToHump(str: string): string {
return letter.toUpperCase()
})
}
export function setCssVar(prop: string, val: any, dom = document.documentElement) {
dom.style.setProperty(prop, val)
}

View File

@@ -122,7 +122,8 @@ export function generateRoutesFn2(routes: AppRouteRecordRaw[]): AppRouteRecordRa
}
export function pathResolve(parentPath: string, path: string) {
return `${parentPath}/${path}`
const childPath = path.startsWith('/') || !path ? path : `/${path}`
return `${parentPath}${childPath}`
}
// 路由降级