Files
BYW-VoiceHub/app/components/UI/Icon.vue
T
Henry_Du 357876a716 fix(ui+permission): 移除联合投稿 / emoji换SVG / 修复移动端浅色适配 / 已排期显示日期 / 隐藏.env提示 / 公开排期档期游客访问
具体改动:

1. feat(投稿表单): 移除 RequestForm.vue 联合投稿功能整套模板+状态+payload+CSS(10处残留)

2. feat(图标): Icon.vue 新增 sparkles/star 图标; 首页档期卡片📅🎵✨和排期列表空状态🎵📅换成 lucide SVG Icon

3. fix(浅色适配): ScheduleList.vue 日期选择弹窗桌面端+移动端(content/header/h3/close-btn/item)全部改为 bg-primary + var text + indigo 主色, 修复竖屏选择日期标题白字看不见

4. feat(歌曲列表): SongList.vue scheduled-tag 内联追加 formatScheduleDate, 徽章+日期双胶囊显示

5. fix(登录): OAuthButtons.vue showPlaceholderHint 强制 false, 隐藏虚线框 .env 配置提示

6. fix(权限): server/middleware/auth.ts + auth-route-policy.ts 双白名单同步追加 /api/expected-play-dates GET 公共访问, 修复未登录 Authentication expired 401
2026-09-19 00:43:46 +08:00

437 lines
18 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<svg
:class="['icon', `icon-${name}`, className]"
:height="size"
:style="{ color }"
:width="size"
fill="none"
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
viewBox="0 0 24 24"
>
<!-- 消息图标 (圆形气泡) -->
<g v-if="name === 'message-circle'">
<path d="M7.9 20A9 9 0 1 0 4 16.1L2 22Z" />
</g>
<!-- 播放图标 -->
<g v-else-if="name === 'play'" fill="currentColor" stroke="none" stroke-width="0">
<path
d="M6.77 2.35Q5.95 1.9 5.08 2.06Q4.2 2.23 3.61 2.9Q3.02 3.58 3.02 4.51L3.02 19.46Q3.02 20.4 3.61 21.08Q4.2 21.77 5.08 21.94Q5.95 22.1 6.77 21.65L19.73 14.16Q20.54 13.7 20.83 12.85Q21.12 12 20.83 11.15Q20.54 10.3 19.73 9.84L6.77 2.35Z"
/>
</g>
<!-- 播放/暂停 -->
<g v-else-if="name === 'pause'">
<rect fill="currentColor" height="16" width="4" x="6" y="4" />
<rect fill="currentColor" height="16" width="4" x="14" y="4" />
</g>
<!-- 播放圈图标 (单曲播放等使用) -->
<g v-else-if="name === 'play-circle'">
<circle cx="12" cy="12" r="10" />
<polygon points="10 8 16 12 10 16 10 8" />
</g>
<!-- 停止图标 -->
<rect v-else-if="name === 'stop'" fill="currentColor" height="14" width="14" x="5" y="5" />
<!-- 音量图标 -->
<g v-else-if="name === 'volume'">
<polygon points="11,5 6,9 2,9 2,15 6,15 11,19" />
<path d="M19.07 4.93a10 10 0 0 1 0 14.14M15.54 8.46a5 5 0 0 1 0 7.07" />
</g>
<!-- 静音图标 -->
<g v-else-if="name === 'volume-mute'">
<polygon points="11,5 6,9 2,9 2,15 6,15 11,19" />
<line x1="23" x2="17" y1="9" y2="15" />
<line x1="17" x2="23" y1="9" y2="15" />
</g>
<!-- 左箭头 -->
<g v-else-if="name === 'chevron-left'">
<polyline points="15,18 9,12 15,6" />
</g>
<!-- 右箭头 -->
<g v-else-if="name === 'chevron-right'">
<polyline points="9,18 15,12 9,6" />
</g>
<!-- 上箭头 -->
<g v-else-if="name === 'chevron-up'">
<polyline points="18,15 12,9 6,15" />
</g>
<!-- 下箭头 -->
<g v-else-if="name === 'chevron-down'">
<polyline points="6,9 12,15 18,9" />
</g>
<!-- 箭头图标 -->
<g v-else-if="name === 'arrow-left' || name === 'back'">
<line x1="19" x2="5" y1="12" y2="12" />
<polyline points="12 19 5 12 12 5" />
</g>
<g v-else-if="name === 'arrow-right'">
<line x1="5" x2="19" y1="12" y2="12" />
<polyline points="12 5 19 12 12 19" />
</g>
<!-- 心形/点赞图标 -->
<path
v-else-if="name === 'heart'"
d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"
/>
<!-- 音乐图标 -->
<g v-else-if="name === 'music'">
<path d="M9 18V5l12-2v13" />
<circle cx="6" cy="18" r="3" />
<circle cx="18" cy="16" r="3" />
</g>
<!-- 视频图标 -->
<g v-else-if="name === 'video'">
<path d="m22 8-6 4 6 4V8Z" />
<rect width="14" height="12" x="2" y="6" rx="2" ry="2" />
</g>
<!-- 目标/选中图标 -->
<g v-else-if="name === 'target'">
<circle cx="12" cy="12" r="10" />
<circle cx="12" cy="12" r="6" />
<circle cx="12" cy="12" r="2" />
</g>
<!-- 拇指向上 -->
<g v-else-if="name === 'thumbs-up'">
<path
d="M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3"
/>
</g>
<!-- 扬声器/广播图标 -->
<g v-else-if="name === 'speaker'">
<rect height="20" rx="2" ry="2" width="16" x="4" y="2" />
<circle cx="12" cy="14" r="4" />
<circle cx="12" cy="6" r="2" />
</g>
<!-- 通知图标 -->
<g v-else-if="name === 'bell'">
<path d="M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9" />
<path d="M13.73 21a2 2 0 0 1-3.46 0" />
</g>
<g v-else-if="name === 'sun'">
<circle cx="12" cy="12" r="4" />
<line x1="12" x2="12" y1="2" y2="4" />
<line x1="12" x2="12" y1="20" y2="22" />
<line x1="4.22" x2="5.64" y1="4.22" y2="5.64" />
<line x1="18.36" x2="19.78" y1="18.36" y2="19.78" />
<line x1="2" x2="4" y1="12" y2="12" />
<line x1="20" x2="22" y1="12" y2="12" />
<line x1="18.36" x2="19.78" y1="5.64" y2="4.22" />
<line x1="4.22" x2="5.64" y1="19.78" y2="18.36" />
</g>
<g v-else-if="name === 'moon'">
<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" />
</g>
<!-- 日历图标 -->
<g v-else-if="name === 'calendar'">
<rect height="18" rx="2" ry="2" width="18" x="3" y="4" />
<line x1="16" x2="16" y1="2" y2="6" />
<line x1="8" x2="8" y1="2" y2="6" />
<line x1="3" x2="21" y1="10" y2="10" />
</g>
<!-- 时钟图标 -->
<g v-else-if="name === 'clock'">
<circle cx="12" cy="12" r="10" />
<polyline points="12,6 12,12 16,14" />
</g>
<!-- 星星/闪耀图标 -->
<g v-else-if="name === 'sparkles' || name === 'star'">
<path d="M12 3l1.8 5.4L19 9.7l-4.2 3.6L16.6 19 12 15.8 7.4 19l1.8-5.7L5 9.7l5.2-1.3L12 3z" />
</g>
<!-- 用户图标 -->
<g v-else-if="name === 'user'">
<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" />
<circle cx="12" cy="7" r="4" />
</g>
<!-- 用户组/多用户图标 -->
<g v-else-if="name === 'users' || name === 'group'">
<path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2" />
<circle cx="9" cy="7" r="4" />
<path d="M23 21v-2a4 4 0 0 0-3-3.87" />
<path d="M16 3.13a4 4 0 0 1 0 7.75" />
</g>
<!-- 设置图标 -->
<g v-else-if="name === 'settings'" fill="currentColor" stroke="none" stroke-width="0">
<path
d="M12.02 9Q12.84 9 13.52 9.41Q14.21 9.82 14.6 10.51Q15 11.21 15 12.02Q15 12.84 14.6 13.52Q14.21 14.21 13.52 14.6Q12.84 15 12 15Q11.18 15 10.49 14.59Q9.79 14.18 9.4 13.49Q9 12.79 9 11.98Q9 11.16 9.41 10.48Q9.82 9.79 10.51 9.4Q11.21 9 12.02 9ZM12.05 7.51Q10.82 7.51 9.78 8.11Q8.74 8.71 8.12 9.73Q7.51 10.75 7.51 11.98Q7.51 13.2 8.11 14.24Q8.71 15.29 9.74 15.9Q10.78 16.51 12 16.51Q13.22 16.51 14.26 15.91Q15.29 15.31 15.9 14.28Q16.51 13.25 16.51 12.02Q16.51 10.8 15.91 9.77Q15.31 8.74 14.29 8.12Q13.27 7.51 12.05 7.51ZM13.56 22.66Q14.02 22.66 14.4 22.4Q14.78 22.15 14.98 21.74L15.79 19.85L15.98 19.75Q16.42 19.49 16.85 19.22L18.91 19.49Q19.39 19.54 19.8 19.33Q20.21 19.13 20.45 18.72L22.03 15.98Q22.27 15.58 22.24 15.12Q22.2 14.66 21.94 14.28L20.69 12.6L20.69 11.42L21.94 9.74Q22.22 9.36 22.25 8.9Q22.27 8.45 22.03 8.04L20.45 5.28Q20.23 4.9 19.82 4.68Q19.42 4.46 18.94 4.51L16.85 4.78Q16.42 4.46 15.86 4.2L15.02 2.23Q14.83 1.82 14.45 1.56Q14.06 1.3 13.61 1.3L10.44 1.3Q9.98 1.3 9.59 1.56Q9.19 1.82 9 2.23L8.16 4.2L7.92 4.34Q7.73 4.44 7.55 4.54Q7.37 4.63 7.2 4.75L5.09 4.51Q4.63 4.44 4.21 4.64Q3.79 4.85 3.55 5.26L1.97 8.02Q1.73 8.4 1.76 8.87Q1.8 9.34 2.06 9.72L3.34 11.42L3.34 12.53L2.06 14.23Q1.78 14.62 1.75 15.07Q1.73 15.53 1.97 15.94L3.53 18.67Q3.77 19.08 4.18 19.28Q4.58 19.49 5.06 19.44L7.13 19.2Q7.8 19.63 8.14 19.8L8.98 21.72Q9.14 22.15 9.53 22.4Q9.91 22.66 10.39 22.66L13.56 22.66ZM7.08 17.66L4.8 17.9L3.22 15.1L4.58 13.27Q4.8 12.94 4.8 12.6Q4.78 12.31 4.78 11.95Q4.78 11.59 4.8 11.3Q4.8 10.92 4.58 10.61L3.22 8.74L4.85 5.95L7.15 6.24Q7.37 6.26 7.55 6.22Q7.73 6.17 7.87 6.07Q8.3 5.76 8.93 5.47Q9.29 5.28 9.43 4.94L10.39 2.78L13.61 2.81L14.52 4.94Q14.64 5.26 15.02 5.47Q15.55 5.71 16.1 6.1Q16.46 6.34 16.82 6.26L19.13 6.02L20.71 8.83L19.37 10.63Q19.1 10.92 19.15 11.33Q19.18 11.64 19.18 12.01Q19.18 12.38 19.15 12.67Q19.13 13.06 19.37 13.37L20.71 15.19L19.08 17.98L16.85 17.71Q16.66 17.69 16.46 17.72Q16.27 17.76 16.13 17.88Q15.6 18.26 15 18.53Q14.83 18.62 14.69 18.76Q14.54 18.89 14.47 19.06L13.56 21.14L10.34 21.12L9.46 19.03Q9.29 18.67 8.95 18.5Q8.47 18.29 7.85 17.88Q7.58 17.69 7.25 17.69Z"
/>
</g>
<!-- 关闭/叉叉图标 -->
<g v-else-if="name === 'x' || name === 'close'">
<line x1="18" x2="6" y1="6" y2="18" />
<line x1="6" x2="18" y1="6" y2="18" />
</g>
<!-- 信息图标 -->
<g v-else-if="name === 'info'">
<circle cx="12" cy="12" r="10" />
<line x1="12" y1="16" x2="12" y2="12" />
<circle cx="12" cy="8" r="1" fill="currentColor" />
</g>
<!-- 成功/勾选图标 -->
<g v-else-if="name === 'check' || name === 'success'">
<polyline points="20 6 9 17 4 12" />
</g>
<!-- 错误/叉叉图标 -->
<g v-else-if="name === 'error' || name === 'x-circle' || name === 'alert-circle'">
<circle
cx="12"
cy="12"
r="10"
fill="currentColor"
fill-opacity="0.1"
stroke="currentColor"
stroke-width="2"
/>
<line x1="15" y1="9" x2="9" y2="15" stroke="currentColor" stroke-width="2" />
<line x1="9" y1="9" x2="15" y2="15" stroke="currentColor" stroke-width="2" />
</g>
<!-- 警告图标 -->
<g v-else-if="name === 'warning' || name === 'alert-triangle'">
<path
d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"
fill="currentColor"
fill-opacity="0.1"
stroke="currentColor"
stroke-width="2"
/>
<line x1="12" y1="9" x2="12" y2="13" stroke="currentColor" stroke-width="2" />
<circle cx="12" cy="17" r="1" fill="currentColor" stroke="none" />
</g>
<!-- 上一首图标 -->
<g v-else-if="name === 'skip-back' || name === 'previous'" fill="currentColor" stroke="none" stroke-width="0">
<path
d="M9.07 10.82Q8.64 11.09 8.47 11.54Q8.3 12 8.47 12.46Q8.64 12.91 9.07 13.18L17.71 18.17Q18.17 18.41 18.64 18.31Q19.1 18.22 19.43 17.84Q19.75 17.47 19.75 16.97L19.75 7.01Q19.75 6.5 19.43 6.14Q19.1 5.78 18.62 5.69Q18.14 5.59 17.71 5.83L9.07 10.82ZM5.26 17.71Q5.66 17.71 5.95 17.42Q6.24 17.14 6.24 16.7L6.24 7.18Q6.24 6.77 5.95 6.47Q5.66 6.17 5.26 6.17Q4.85 6.17 4.55 6.47Q4.25 6.77 4.25 7.18L4.25 16.7Q4.25 17.14 4.55 17.42Q4.85 17.71 5.26 17.71Z"
/>
</g>
<!-- 下一首图标 -->
<g v-else-if="name === 'skip-forward' || name === 'next'" fill="currentColor" stroke="none" stroke-width="0">
<path
d="M6.29 5.83Q5.86 5.59 5.38 5.69Q4.9 5.78 4.57 6.14Q4.25 6.5 4.25 7.01L4.25 16.97Q4.25 17.47 4.57 17.84Q4.9 18.22 5.36 18.31Q5.83 18.41 6.29 18.17L14.9 13.18Q15.34 12.91 15.5 12.46Q15.67 12 15.5 11.54Q15.34 11.09 14.9 10.82L6.29 5.83ZM18.74 17.71Q19.15 17.71 19.45 17.42Q19.75 17.14 19.75 16.7L19.75 7.18Q19.75 6.77 19.45 6.47Q19.15 6.17 18.74 6.17Q18.34 6.17 18.05 6.47Q17.76 6.77 17.76 7.18L17.76 16.7Q17.76 17.14 18.05 17.42Q18.34 17.71 18.74 17.71Z"
/>
</g>
<!-- 快退图标 -->
<g v-else-if="name === 'rewind'">
<polygon fill="currentColor" points="11,19 2,12 11,5" />
<polygon fill="currentColor" points="22,19 13,12 22,5" />
</g>
<!-- 快进图标 -->
<g v-else-if="name === 'fast-forward'">
<polygon fill="currentColor" points="13,19 22,12 13,5" />
<polygon fill="currentColor" points="2,19 11,12 2,5" />
</g>
<!-- 歌词图标 -->
<g v-else-if="name === 'lyrics'">
<!-- 音符基础形状 -->
<path d="M9 18V5l12-2v13" fill="none" stroke="currentColor" stroke-width="1.5" />
<circle cx="6" cy="18" fill="currentColor" r="3" />
<circle cx="18" cy="16" fill="currentColor" r="3" />
<!-- 歌词文本线条 -->
<line
stroke="currentColor"
stroke-linecap="round"
stroke-width="1.5"
x1="2"
x2="7"
y1="8"
y2="8"
/>
<line
stroke="currentColor"
stroke-linecap="round"
stroke-width="1.5"
x1="2"
x2="9"
y1="12"
y2="12"
/>
<line
stroke="currentColor"
stroke-linecap="round"
stroke-width="1.5"
x1="2"
x2="6"
y1="16"
y2="16"
/>
</g>
<!-- 刷新图标 -->
<g v-else-if="name === 'refresh' || name === 'rotate-cw'">
<polyline points="23 4 23 10 17 10" />
<polyline points="1 20 1 14 7 14" />
<path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15" />
</g>
<!-- 垃圾桶/删除图标 -->
<g v-else-if="name === 'trash' || name === 'delete'">
<polyline points="3 6 5 6 21 6" />
<path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" />
<line x1="10" x2="10" y1="11" y2="17" />
<line x1="14" x2="14" y1="11" y2="17" />
</g>
<!-- 加载中图标 -->
<g v-else-if="name === 'loader' || name === 'spinner'">
<line x1="12" x2="12" y1="2" y2="6" />
<line x1="12" x2="12" y1="18" y2="22" />
<line x1="4.93" x2="7.76" y1="4.93" y2="7.76" />
<line x1="16.24" x2="19.07" y1="16.24" y2="19.07" />
<line x1="2" x2="6" y1="12" y2="12" />
<line x1="18" x2="22" y1="12" y2="12" />
<line x1="4.93" x2="7.76" y1="19.07" y2="16.24" />
<line x1="16.24" x2="19.07" y1="7.76" y2="4.93" />
</g>
<!-- 加号/添加图标 -->
<g v-else-if="name === 'plus' || name === 'add'">
<line x1="12" x2="12" y1="5" y2="19" />
<line x1="5" x2="19" y1="12" y2="12" />
</g>
<!-- 历史记录图标 -->
<g v-else-if="name === 'history'">
<path d="M12 2a10 10 0 1 0 10 10 10 10 0 0 0-10-10z" />
<polyline points="12 6 12 12 16 14" />
</g>
<!-- 歌单/列表图标 -->
<g v-else-if="name === 'playlist' || name === 'list' || name === 'order' || name === 'list-ordered'" fill="currentColor" stroke="none" stroke-width="0">
<path
d="M11.76 5.06Q12.07 5.06 12.3 4.85Q12.53 4.63 12.53 4.32Q12.53 4.01 12.3 3.79Q12.07 3.58 11.76 3.58L3.29 3.58Q2.98 3.58 2.75 3.79Q2.52 4.01 2.52 4.32Q2.52 4.63 2.75 4.85Q2.98 5.06 3.29 5.06L11.76 5.06ZM12.53 10.32Q12.53 10.01 12.3 9.79Q12.07 9.58 11.76 9.58L3.29 9.58Q2.98 9.58 2.75 9.79Q2.52 10.01 2.52 10.32Q2.52 10.63 2.75 10.85Q2.98 11.06 3.29 11.06L11.76 11.06Q12.07 11.06 12.3 10.85Q12.53 10.63 12.53 10.32ZM3.29 15.58Q2.98 15.58 2.75 15.79Q2.52 16.01 2.52 16.32Q2.52 16.63 2.75 16.85Q2.98 17.06 3.29 17.06L7.75 17.06Q8.06 17.06 8.28 16.85Q8.5 16.63 8.5 16.32Q8.5 16.01 8.28 15.79Q8.06 15.58 7.75 15.58L3.29 15.58Z"
/>
<path
d="M18.36 3.89Q17.86 3.94 17.53 4.31Q17.21 4.68 17.21 5.21L17.23 6.91L17.23 13.13Q17.23 13.44 17.11 13.67Q16.99 13.9 16.75 14.09Q16.42 14.35 15.41 14.74L15.34 14.76Q14.14 15.24 13.38 15.74Q12.62 16.25 12.26 17.16Q12.05 17.76 12.13 18.36Q12.22 18.96 12.6 19.44Q13.1 20.06 13.94 20.3Q14.78 20.54 15.53 20.45Q17.35 20.23 18.04 19.01Q18.72 17.78 18.72 16.37L18.72 6.94Q18.77 6.53 18.92 6.38Q19.08 6.24 19.46 6.12Q20.09 5.88 20.38 5.69Q21.05 5.28 21.3 4.73Q21.55 4.18 21.41 3.5L18.36 3.89ZM15.36 18.98Q14.83 19.03 14.41 18.91Q13.99 18.79 13.78 18.53Q13.66 18.34 13.62 18.13Q13.58 17.93 13.68 17.69Q13.87 17.18 14.41 16.86Q14.95 16.54 15.89 16.15L15.96 16.13L16.1 16.06Q16.42 15.94 16.72 15.8Q17.02 15.67 17.21 15.55L17.21 16.63Q17.21 17.4 16.85 18.13Q16.49 18.86 15.36 18.98Z"
/>
</g>
<!-- 登出/退出图标 -->
<g v-else-if="name === 'logout' || name === 'log-out'">
<path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" />
<polyline points="16 17 21 12 16 7" />
<line x1="21" x2="9" y1="12" y2="12" />
</g>
<!-- 下载图标 -->
<g v-else-if="name === 'download'">
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />
<polyline points="7 10 12 15 17 10" />
<line x1="12" x2="12" y1="15" y2="3" />
</g>
<!-- 重播/循环图标 -->
<g v-else-if="name === 'repeat'">
<polyline points="17 1 21 5 17 9" />
<path d="M3 11V9a4 4 0 0 1 4-4h14" />
<polyline points="7 23 3 19 7 15" />
<path d="M21 13v2a4 4 0 0 1-4 4H3" />
</g>
<!-- 单曲循环图标 -->
<g v-else-if="name === 'repeat-one'" fill="currentColor" stroke="none" stroke-width="0">
<path
d="M12.65 14.95Q12.94 14.95 13.09 14.78Q13.25 14.62 13.25 14.3L13.25 9.67Q13.25 9.12 12.89 9.05Q12.53 8.98 11.95 9.24L10.97 9.82Q10.61 10.01 10.54 10.2Q10.46 10.39 10.54 10.63Q10.58 10.8 10.81 10.86Q11.04 10.92 11.3 10.78L12.07 10.34L12.07 14.33Q12.07 14.64 12.22 14.8Q12.36 14.95 12.65 14.95Z"
/>
<path
d="M16.66 7.27L19.63 7.27Q19.78 7.27 19.88 7.16Q19.99 7.06 19.99 6.91Q19.99 6.77 19.87 6.65L16.99 3.84Q16.9 3.72 16.75 3.72Q16.61 3.72 16.5 3.83Q16.39 3.94 16.39 4.08L16.39 5.76L7.32 5.76Q5.62 5.76 4.18 6.6Q2.74 7.44 1.9 8.88Q1.06 10.32 1.06 12Q1.06 13.63 1.85 15.05Q2.02 15.36 2.33 15.42Q2.64 15.48 2.88 15.34Q3.14 15.17 3.23 14.87Q3.31 14.57 3.17 14.3Q2.57 13.27 2.57 12Q2.57 10.7 3.2 9.62Q3.84 8.54 4.93 7.91Q6.02 7.27 7.32 7.27ZM22.15 8.95Q22.01 8.69 21.7 8.6Q21.38 8.52 21.12 8.66Q20.86 8.81 20.77 9.11Q20.69 9.41 20.83 9.67Q21.43 10.73 21.43 11.98Q21.43 13.27 20.8 14.36Q20.16 15.46 19.07 16.09Q17.98 16.73 16.68 16.73L7.34 16.73L4.37 16.73Q4.22 16.73 4.13 16.84Q4.03 16.94 4.03 17.09Q4.03 17.23 4.13 17.33L7.01 20.16Q7.1 20.26 7.25 20.26Q7.39 20.26 7.5 20.15Q7.61 20.04 7.61 19.9L7.61 18.22L16.68 18.22Q18.38 18.22 19.82 17.38Q21.26 16.54 22.1 15.1Q22.94 13.66 22.94 11.98Q22.94 10.32 22.15 8.95Z"
/>
</g>
<!-- 搜索图标 -->
<g v-else-if="name === 'search'">
<circle cx="11" cy="11" r="8" />
<line x1="21" x2="16.65" y1="21" y2="16.65" />
</g>
<!-- 上传图标 -->
<g v-else-if="name === 'upload'">
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />
<polyline points="17 8 12 3 7 8" />
<line x1="12" x2="12" y1="3" y2="15" />
</g>
<!-- 云上传图标 -->
<g v-else-if="name === 'cloud-upload'">
<path d="M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3" />
<polyline points="16 16 12 12 8 16" />
<line x1="12" y1="12" x2="12" y2="21" />
</g>
<!-- 默认图标(如果没有匹配的图标) -->
<circle v-else cx="12" cy="12" r="10" />
</svg>
</template>
<script setup>
defineProps({
name: {
type: String,
required: true
},
size: {
type: [String, Number],
default: 24
},
color: {
type: String,
default: 'currentColor'
},
className: {
type: String,
default: ''
}
})
</script>
<style scoped>
.icon {
display: inline-block;
vertical-align: middle;
transition: all 0.2s ease;
/* 确保SVG在所有设备上渲染一致 */
shape-rendering: geometricPrecision;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon:hover {
transform: scale(1.05);
}
</style>