初始化

This commit is contained in:
李琦
2026-01-15 13:51:44 +08:00
commit b7b6d3e39e
156 changed files with 38913 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
<template>
<i
:data-lucide="name"
:class="className"
:style="style"
ref="iconRef"
></i>
</template>
<script setup lang="ts">
import { ref, onMounted, watch } from 'vue'
interface Props {
name: string
className?: string
style?: Record<string, any>
}
const props = withDefaults(defineProps<Props>(), {
className: '',
style: () => ({})
})
const iconRef = ref<HTMLElement | null>(null)
const updateIcon = () => {
if (window.lucide && iconRef.value) {
// 重新创建图标
window.lucide.createIcons()
}
}
onMounted(() => {
updateIcon()
})
watch(() => props.name, () => {
updateIcon()
})
</script>