mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2025-12-16 08:38:48 +00:00
22 lines
420 B
TypeScript
22 lines
420 B
TypeScript
export function revisePath(path: string) {
|
|
if (!path) {
|
|
return "";
|
|
}
|
|
|
|
return path[0] == "/" ? path : `/${path}`;
|
|
}
|
|
|
|
export function createLink(url: string, id?: string) {
|
|
const link = document.createElement("link");
|
|
link.href = url;
|
|
link.type = "text/css";
|
|
link.rel = "stylesheet";
|
|
if (id) {
|
|
link.id = id;
|
|
}
|
|
|
|
setTimeout(() => {
|
|
document.getElementsByTagName("head").item(0)?.appendChild(link);
|
|
}, 0);
|
|
}
|