From 26fef2fd7a8e325babfca4bf0dde388baa0cbe10 Mon Sep 17 00:00:00 2001 From: chaos Date: Sat, 22 Nov 2025 13:50:58 +0800 Subject: [PATCH] =?UTF-8?q?feat(icon):=20=E6=B7=BB=E5=8A=A0=E5=9B=BE?= =?UTF-8?q?=E6=A0=87=E7=BB=84=E4=BB=B6=E5=B9=B6=E6=9B=B4=E6=96=B0=E5=9B=BE?= =?UTF-8?q?=E6=A0=87=E7=B1=BB=E5=9E=8B=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 引入 Icon 组件到 dashboard 页面 - 更新 icon-ids.ts 文件中的图标枚举类型 - 在 Sprite.svelte 中添加新的图标 symbol 定义 - 移除旧的 sprite.svg 文件内容 - 为 panel-right-close 和 panel-right-close-solid 图标添加 SVG 路径定义 --- src/lib/assets/sprite.svg | 10 ++-------- src/lib/components/icon/Sprite.svelte | 16 ++++++++++++---- src/lib/types/icon-ids.ts | 7 ++++--- src/routes/app/dashboard/+page.svelte | 6 +++++- 4 files changed, 23 insertions(+), 16 deletions(-) diff --git a/src/lib/assets/sprite.svg b/src/lib/assets/sprite.svg index 04282cf..139597f 100644 --- a/src/lib/assets/sprite.svg +++ b/src/lib/assets/sprite.svg @@ -1,8 +1,2 @@ - - - - - - - - \ No newline at end of file + + diff --git a/src/lib/components/icon/Sprite.svelte b/src/lib/components/icon/Sprite.svelte index 36f31bc..997546e 100644 --- a/src/lib/components/icon/Sprite.svelte +++ b/src/lib/components/icon/Sprite.svelte @@ -1,9 +1,17 @@ - - {@html SpriteSvg} + + + + + + + + + + + \ No newline at end of file diff --git a/src/lib/types/icon-ids.ts b/src/lib/types/icon-ids.ts index 85aa646..b1efa9c 100644 --- a/src/lib/types/icon-ids.ts +++ b/src/lib/types/icon-ids.ts @@ -1,3 +1,4 @@ -export type IconId = { - [key: string]: string; -}; \ No newline at end of file +export type IconId = + "panel-right-close" | + "panel-right-close-solid" +; \ No newline at end of file diff --git a/src/routes/app/dashboard/+page.svelte b/src/routes/app/dashboard/+page.svelte index 52e0548..d53f2a4 100644 --- a/src/routes/app/dashboard/+page.svelte +++ b/src/routes/app/dashboard/+page.svelte @@ -5,6 +5,7 @@ import { authService } from '$lib/api/services/authService.ts'; import ThemeSelector from '$lib/widget/ThemeSelector.svelte'; import { sidebarStore, toggleSidebarOpen } from '$lib/stores/sidebarStore'; + import Icon from '$lib/components/icon/Icon.svelte'; @@ -25,7 +26,10 @@ class="p-2 hover:bg-gray-700/50 rounded-full transition-colors" aria-label="Toggle Menu" > - 123 + +
1