Files
EmailBill/Web/src/components/Icon.vue
SunCheng 5e38a52e5b
All checks were successful
Docker Build & Deploy / Build Docker Image (push) Successful in 18s
Docker Build & Deploy / Deploy to Production (push) Successful in 5s
Docker Build & Deploy / Cleanup Dangling Images (push) Successful in 1s
Docker Build & Deploy / WeChat Notification (push) Successful in 2s
fix: 修复 TypeScript interface 语法错误
- 将 BaseChart.vue、Icon.vue、IconSelector.vue 从 TypeScript 转换为 JavaScript
- 移除 interface 声明,改用 defineProps 对象语法
- 移除类型注解,保持 JavaScript 兼容性
- 修复 ESLint 解析错误,现在所有 lint 检查通过
2026-02-18 22:09:19 +08:00

63 lines
1.1 KiB
Vue

<template>
<span
class="iconify"
:data-icon="iconIdentifier"
:style="iconStyle"
/>
</template>
<script setup>
import { computed } from 'vue'
const props = defineProps({
iconIdentifier: {
type: String,
required: true
},
width: {
type: [String, Number],
default: '1em'
},
height: {
type: [String, Number],
default: '1em'
},
color: {
type: String,
default: undefined
},
size: {
type: [String, Number],
default: undefined
}
})
const iconStyle = computed(() => {
const style = {}
if (props.width) {
style.width = typeof props.width === 'number' ? `${props.width}px` : props.width
}
if (props.height) {
style.height = typeof props.height === 'number' ? `${props.height}px` : props.height
}
if (props.color) {
style.color = props.color
}
if (props.size) {
const size = typeof props.size === 'number' ? `${props.size}px` : props.size
style.fontSize = size
}
return style
})
</script>
<style scoped lang="scss">
.iconify {
display: inline-block;
vertical-align: middle;
line-height: 1;
}
</style>