Files
EmailBill/Web/src/components/Icon.vue
SunCheng 9921cd5fdf chore: migrate remaining ECharts components to Chart.js
- Migrated 4 components from ECharts to Chart.js:
  * MonthlyExpenseCard.vue (折线图)
  * DailyTrendChart.vue (双系列折线图)
  * ExpenseCategoryCard.vue (环形图)
  * BudgetChartAnalysis.vue (仪表盘 + 多种图表)

- Removed all ECharts imports and environment variable switches
- Unified all charts to use BaseChart.vue component
- Build verified: pnpm build success ✓
- No echarts imports remaining ✓

Refs: openspec/changes/migrate-remaining-echarts-to-chartjs
2026-02-16 21:55:38 +08:00

55 lines
1.1 KiB
Vue

<template>
<span
class="iconify"
:data-icon="iconIdentifier"
:style="iconStyle"
></span>
</template>
<script setup lang="ts">
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 iconStyle = computed(() => {
const style: Record<string, string> = {}
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>