From 71f19b658c03cabd895ae2237d631d6577f9c78c Mon Sep 17 00:00:00 2001 From: Chaos Date: Sun, 23 Nov 2025 21:59:47 +0800 Subject: [PATCH] =?UTF-8?q?feat(toast):=20=E4=BD=BF=E7=94=A8SVG=E5=9B=BE?= =?UTF-8?q?=E6=A0=87=E6=9B=BF=E6=8D=A2=E5=AD=97=E7=AC=A6=E5=9B=BE=E6=A0=87?= =?UTF-8?q?=E5=B9=B6=E4=BC=98=E5=8C=96=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增四种SVG图标:info、success、warning、error - 修改Toast组件使用SVG图标替代字符图标 - 更新图标映射逻辑,使用IconId类型定义图标标识 - 调整Toast样式类,使用更具体的Tailwind类名 - 移除旧的alertStyles对象和字符图标映射 - 登录页面增加错误处理和Toast提示 - 布局文件微调菜单样式,增加顶部内边距 --- src/lib/components/ToastContainer.svelte | 27 +++++++++--------------- src/lib/components/icon/Sprite.svelte | 17 +++++++++++++++ src/lib/types/icon-ids.ts | 6 +++++- src/routes/app/+layout.svelte | 2 +- src/routes/auth/login/+page.svelte | 12 ++++++++--- 5 files changed, 42 insertions(+), 22 deletions(-) diff --git a/src/lib/components/ToastContainer.svelte b/src/lib/components/ToastContainer.svelte index b568369..4b07cea 100644 --- a/src/lib/components/ToastContainer.svelte +++ b/src/lib/components/ToastContainer.svelte @@ -1,22 +1,15 @@ @@ -25,9 +18,9 @@
- {icons[t.type]} + {t.message}
{/each} diff --git a/src/lib/components/icon/Sprite.svelte b/src/lib/components/icon/Sprite.svelte index 2624d1a..ba744f7 100644 --- a/src/lib/components/icon/Sprite.svelte +++ b/src/lib/components/icon/Sprite.svelte @@ -120,4 +120,21 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/lib/types/icon-ids.ts b/src/lib/types/icon-ids.ts index 50848c0..7ac85d4 100644 --- a/src/lib/types/icon-ids.ts +++ b/src/lib/types/icon-ids.ts @@ -7,5 +7,9 @@ export type IconId = "starburst"| "home"| "menu"| - "logo" + "logo"| + "success"| + "error"| + "warning"| + "info" ; \ No newline at end of file diff --git a/src/routes/app/+layout.svelte b/src/routes/app/+layout.svelte index 38ed622..bb9b940 100644 --- a/src/routes/app/+layout.svelte +++ b/src/routes/app/+layout.svelte @@ -89,7 +89,7 @@ -