Skip to content

Commit 6626ac5

Browse files
committed
mod(message-component): replacing iconify/vue to static component
1 parent 9a5e466 commit 6626ac5

File tree

8 files changed

+89
-10
lines changed

8 files changed

+89
-10
lines changed

app/components/kun/alert/Info.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<script setup lang="ts">
22
import { ref } from 'vue'
3-
import { Icon } from '@iconify/vue'
43
import img from './loli'
54
65
const { loli, name } = img
@@ -83,7 +82,7 @@ onBeforeUnmount(() => {
8382
class="hover:bg-default/40 absolute top-1 right-1 inline-flex cursor-pointer overflow-hidden rounded-full border-transparent bg-transparent p-2 text-sm font-medium transition-all hover:opacity-80 active:scale-[0.97] disabled:opacity-50"
8483
@click="close"
8584
>
86-
<Icon icon="lucide:x" />
85+
<KunIconLucideX class="h-4 w-4" />
8786
</button>
8887

8988
<span

app/components/kun/alert/MessageItem.vue

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<script setup lang="ts">
22
import { computed, onMounted, onUnmounted, ref, watch } from 'vue'
3-
import { Icon } from '@iconify/vue'
3+
import LucideAlertTriangle from '~/components/kun/icon/LucideAlertTriangle.vue'
4+
import LucideCheckCircle2 from '~/components/kun/icon/LucideCheckCircle2.vue'
5+
import LucideInfo from '~/components/kun/icon/LucideInfo.vue'
6+
import LucideXCircle from '~/components/kun/icon/LucideXCircle.vue'
47
import type { KunMessageType } from '~/composables/useMessage'
58
69
const props = defineProps<{
@@ -83,23 +86,23 @@ const typeStyles = computed(() => {
8386
text: 'text-success-800',
8487
icon: 'text-success-500',
8588
progress: 'bg-success-400',
86-
iconName: 'lucide:check-circle-2'
89+
iconComponent: LucideCheckCircle2
8790
}
8891
case 'error':
8992
return {
9093
bg: 'bg-danger-50 dark:bg-danger-50/90',
9194
text: 'text-danger-800',
9295
icon: 'text-danger-500',
9396
progress: 'bg-danger-400',
94-
iconName: 'lucide:x-circle'
97+
iconComponent: LucideXCircle
9598
}
9699
case 'warn':
97100
return {
98101
bg: 'bg-warning-50 dark:bg-warning-50/90',
99102
text: 'text-warning-800',
100103
icon: 'text-warning-500',
101104
progress: 'bg-warning-400',
102-
iconName: 'lucide:alert-triangle'
105+
iconComponent: LucideAlertTriangle
103106
}
104107
case 'info':
105108
default:
@@ -108,7 +111,7 @@ const typeStyles = computed(() => {
108111
text: 'text-primary-800',
109112
icon: 'text-primary-500',
110113
progress: 'bg-primary-400',
111-
iconName: 'lucide:info'
114+
iconComponent: LucideInfo
112115
}
113116
}
114117
})
@@ -126,9 +129,9 @@ const typeStyles = computed(() => {
126129
@mouseenter="pauseTimer"
127130
@mouseleave="resumeTimer"
128131
>
129-
<Icon
132+
<component
133+
:is="typeStyles.iconComponent"
130134
:class="cn('mt-0.5 mr-3 h-6 w-6 flex-shrink-0', typeStyles.icon)"
131-
:icon="typeStyles.iconName"
132135
/>
133136

134137
<div class="flex-1 text-sm font-medium">
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<template>
2+
<svg
3+
xmlns="http://www.w3.org/2000/svg"
4+
viewBox="0 0 24 24"
5+
fill="none"
6+
stroke="currentColor"
7+
stroke-width="2"
8+
stroke-linecap="round"
9+
stroke-linejoin="round"
10+
aria-hidden="true"
11+
>
12+
<path d="m21.73 18-8-14a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4.27 21h15.46A2 2 0 0 0 21.73 18" />
13+
<path d="M12 9v4" />
14+
<path d="M12 17h.01" />
15+
</svg>
16+
</template>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<template>
2+
<svg
3+
xmlns="http://www.w3.org/2000/svg"
4+
viewBox="0 0 24 24"
5+
fill="none"
6+
stroke="currentColor"
7+
stroke-width="2"
8+
stroke-linecap="round"
9+
stroke-linejoin="round"
10+
aria-hidden="true"
11+
>
12+
<circle cx="12" cy="12" r="10" />
13+
<path d="m9 12 2 2 4-4" />
14+
</svg>
15+
</template>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<template>
2+
<svg
3+
xmlns="http://www.w3.org/2000/svg"
4+
viewBox="0 0 24 24"
5+
fill="none"
6+
stroke="currentColor"
7+
stroke-width="2"
8+
stroke-linecap="round"
9+
stroke-linejoin="round"
10+
aria-hidden="true"
11+
>
12+
<circle cx="12" cy="12" r="10" />
13+
<path d="M12 16v-4" />
14+
<path d="M12 8h.01" />
15+
</svg>
16+
</template>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<template>
2+
<svg
3+
xmlns="http://www.w3.org/2000/svg"
4+
viewBox="0 0 24 24"
5+
fill="none"
6+
stroke="currentColor"
7+
stroke-width="2"
8+
stroke-linecap="round"
9+
stroke-linejoin="round"
10+
aria-hidden="true"
11+
>
12+
<path d="M18 6 6 18" />
13+
<path d="M6 6l12 12" />
14+
</svg>
15+
</template>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<template>
2+
<svg
3+
xmlns="http://www.w3.org/2000/svg"
4+
viewBox="0 0 24 24"
5+
fill="none"
6+
stroke="currentColor"
7+
stroke-width="2"
8+
stroke-linecap="round"
9+
stroke-linejoin="round"
10+
aria-hidden="true"
11+
>
12+
<circle cx="12" cy="12" r="10" />
13+
<path d="m15 9-6 6m0-6 6 6" />
14+
</svg>
15+
</template>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "kun-galgame-nuxt4",
3-
"version": "5.0.51",
3+
"version": "5.0.52",
44
"type": "module",
55
"packageManager": "pnpm@10.17.1",
66
"private": true,

0 commit comments

Comments
 (0)