style(frontend): 优化 Components 代码风格和结构

- 统一移除语句末尾分号,规范代码格式
- 优化组件类型定义和 props 声明
- 改进组件文档和示例代码
- 提升代码可读性和一致性
This commit is contained in:
ianshaw
2025-12-25 08:40:12 -08:00
parent 1ac8b1f03e
commit 5deef27e1d
38 changed files with 2582 additions and 1485 deletions

View File

@@ -1,24 +1,16 @@
<template>
<div class="stat-card">
<div :class="['stat-icon', iconClass]">
<component
v-if="icon"
:is="icon"
class="w-6 h-6"
aria-hidden="true"
/>
<component v-if="icon" :is="icon" class="h-6 w-6" aria-hidden="true" />
</div>
<div class="flex-1 min-w-0">
<div class="min-w-0 flex-1">
<p class="stat-label truncate">{{ title }}</p>
<div class="flex items-baseline gap-2 mt-1">
<div class="mt-1 flex items-baseline gap-2">
<p class="stat-value">{{ formattedValue }}</p>
<span
v-if="change !== undefined"
:class="['stat-trend', trendClass]"
>
<span v-if="change !== undefined" :class="['stat-trend', trendClass]">
<svg
v-if="changeType !== 'neutral'"
:class="['w-3 h-3', changeType === 'down' && 'rotate-180']"
:class="['h-3 w-3', changeType === 'down' && 'rotate-180']"
fill="currentColor"
viewBox="0 0 20 20"
>