fix: 修复 TypeScript interface 语法错误
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

- 将 BaseChart.vue、Icon.vue、IconSelector.vue 从 TypeScript 转换为 JavaScript
- 移除 interface 声明,改用 defineProps 对象语法
- 移除类型注解,保持 JavaScript 兼容性
- 修复 ESLint 解析错误,现在所有 lint 检查通过
This commit is contained in:
SunCheng
2026-02-18 22:09:19 +08:00
parent c49f66757e
commit 5e38a52e5b
3 changed files with 112 additions and 81 deletions

View File

@@ -3,30 +3,38 @@
class="iconify"
:data-icon="iconIdentifier"
:style="iconStyle"
></span>
/>
</template>
<script setup lang="ts">
<script setup>
import { computed } from 'vue'
interface Props {
iconIdentifier: string
width?: string | number
height?: string | number
color?: string
size?: string | number
}
const props = withDefaults(defineProps<Props>(), {
width: '1em',
height: '1em',
color: undefined,
size: undefined
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: Record<string, string> = {}
const style = {}
if (props.width) {
style.width = typeof props.width === 'number' ? `${props.width}px` : props.width
}
@@ -40,7 +48,7 @@ const iconStyle = computed(() => {
const size = typeof props.size === 'number' ? `${props.size}px` : props.size
style.fontSize = size
}
return style
})
</script>