refactor: 优化代码格式和注释
- 移除不必要的注释标记 - 简化CountTo组件属性格式 - 禁用不可编辑的输入框
This commit is contained in:
@ -50,7 +50,7 @@ const form = reactive({
|
||||
<div class="mb-2 text-xs text-gray-400 font-medium">
|
||||
参赛总人数
|
||||
</div>
|
||||
<NInputNumber v-if="isEdit" v-model:value="form.total" :show-button="false">
|
||||
<NInputNumber v-if="isEdit" v-model:value="form.total" :disabled="true" :show-button="false">
|
||||
<template #suffix>
|
||||
人
|
||||
</template>
|
||||
@ -66,8 +66,8 @@ const form = reactive({
|
||||
分组配额
|
||||
</div>
|
||||
<div v-if="isEdit" class="flex gap-2">
|
||||
<NInputNumber v-model:value="form.teamPerGroup" size="small" placeholder="单组" :show-button="false" />
|
||||
<NInputNumber v-model:value="form.promoteCount" size="small" placeholder="晋级" :show-button="false" />
|
||||
<NInputNumber v-model:value="form.teamPerGroup" :disabled="true" size="small" placeholder="单组" :show-button="false" />
|
||||
<NInputNumber v-model:value="form.promoteCount" :disabled="true" size="small" placeholder="晋级" :show-button="false" />
|
||||
</div>
|
||||
<div v-else class="flex items-center gap-3 text-sm text-gray-700">
|
||||
<span>单组: <strong>{{ form.teamPerGroup }}队</strong></span>
|
||||
|
||||
@ -82,7 +82,6 @@ function getGradientColor(color: CardData['color']) {
|
||||
|
||||
<template>
|
||||
<NCard :bordered="false" size="small" class="card-wrapper">
|
||||
<!-- define component start: GradientBg -->
|
||||
<DefineGradientBg v-slot="{ $slots, gradientColor }">
|
||||
<div
|
||||
class="px-16px pb-4px pt-8px text-white"
|
||||
@ -91,8 +90,6 @@ function getGradientColor(color: CardData['color']) {
|
||||
<component :is="$slots.default" />
|
||||
</div>
|
||||
</DefineGradientBg>
|
||||
<!-- define component end: GradientBg -->
|
||||
|
||||
<NGrid cols="s:1 m:2 l:4" responsive="screen" :x-gap="16" :y-gap="16">
|
||||
<NGi v-for="item in cardData" :key="item.key">
|
||||
<GradientBg :gradient-color="getGradientColor(item.color)" class="flex-1">
|
||||
@ -102,9 +99,7 @@ function getGradientColor(color: CardData['color']) {
|
||||
<div class="flex justify-between pt-12px">
|
||||
<SvgIcon :icon="item.icon" class="text-32px" />
|
||||
<CountTo
|
||||
:prefix="item.unit"
|
||||
:start-value="1"
|
||||
:end-value="item.value"
|
||||
:prefix="item.unit" :start-value="1" :end-value="item.value"
|
||||
class="text-30px text-white dark:text-dark"
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user