feat: add dashboard page

This commit is contained in:
vben
2024-06-23 23:18:55 +08:00
parent 199d5506ac
commit c58c0797ba
100 changed files with 1908 additions and 1081 deletions

View File

@@ -37,14 +37,15 @@ async function loadSvgIcons() {
await Promise.all(
Object.entries(svgEagers).map((svg) => {
const [key, body] = svg as [string, string];
const [key, body] = svg as [string, { default: string } | string];
// ./icons/xxxx.svg => xxxxxx
const start = key.lastIndexOf('/') + 1;
const end = key.lastIndexOf('.');
const iconName = key.slice(start, end);
return addIcon(`svg-icon:${iconName}`, {
body,
return addIcon(`svg:${iconName}`, {
body: typeof body === 'object' ? body.default : body,
});
}),
);