From c56f1d6c8c31a160ff4aec2c0088116dc246249c Mon Sep 17 00:00:00 2001
From: yang <30883395+webvs2@users.noreply.github.com>
Date: Tue, 7 Feb 2023 15:21:13 +0800
Subject: [PATCH] Statistic: Update code and doc (#22276)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* Modifying Spaces
Modifying Spaces
* statistic:Updated countdown feature to localize lodash
* statistic: optimize
* Statistic:优化代码逻辑 修改中文文档
* statistic:Optimize the code logic and adjust the style
---
examples/docs/zh-CN/statistic.md | 30 ++++++------
packages/statistic/src/main.vue | 39 ++++++++--------
packages/theme-chalk/src/statistic.scss | 61 +++++++++++++------------
3 files changed, 64 insertions(+), 66 deletions(-)
diff --git a/examples/docs/zh-CN/statistic.md b/examples/docs/zh-CN/statistic.md
index 62402f986..308e3d3f8 100644
--- a/examples/docs/zh-CN/statistic.md
+++ b/examples/docs/zh-CN/statistic.md
@@ -81,8 +81,6 @@ export default {
### 倒计时
:::warning
-suspend 暂定,它**只是暂停倒计时,并非暂停了时间,因为value指向的是未来的时间节点**。
-
如果需要在原基础上添加时间,请注意:整体的时间(添加的时间量和原定时间)必须是**未来**的时间节点,否则依旧是倒计时结束
:::
:::demo 通过 `value` 提供未来的时间,将开启倒计时功能
@@ -99,7 +97,7 @@ suspend 暂定,它**只是暂停倒计时,并非暂停了时间,因为valu
-
+
add 10 second
@@ -136,7 +134,8 @@ export default {
deadline: Date.now() + 1000 * 60 * 60 * 24 * 2,
deadline2: Date.now() + 1000 * 60 * 60 * 8,
deadline3: Date.now() + 1000 * 60 *30,
- deadline4: Date.now() + (new Date().setHours(23,59,59)-Date.now()) ,
+ deadline4: Date.now() + (new Date().setHours(23,59,59)-Date.now()) ,
+ stop:true
};
},
methods: {
@@ -144,7 +143,8 @@ export default {
this.$notify({
title: '提示',
message: '时间已到,你可知寸金难买寸光阴?',
- duration: 0
+ duration: 0,
+
});
},
clickFn(){
@@ -174,16 +174,16 @@ export default {
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|------------- |---------------- |---------------- |---------------------- |-------- |
-| value | 数值内容 | string \| number | - | - |
-| decimal-separator | 设置小数点 | string | - | . |
-| formatter | 自定义数值展示| v-slot \|({value}) => VNode | - | - |
-| group-separator | 设置千分位标识符 | string | - | , |
-| precision | 数值精度 | number | - | 0 |
-| prefix | 设置数值的前缀 | string \| v-slot | - | - |
-| suffix |设置数值的后缀 | string \| v-slot | - | - |
-| title | 数值的标题 | string \| v-slot | - | - |
-| value-style | 设置数值的样式 | style | - | - |
-| rate | 设置倍率 | number | - | 1000 |
+| value | 数值内容 | string \| number |— | — |
+| decimal-separator | 设置小数点 | string | — | . |
+| formatter | 自定义数值展示| v-slot \|({value}) => VNode |— | — |
+| group-separator | 设置千分位标识符 | string | — | , |
+| precision | 数值精度 | number | — | 0 |
+| prefix | 设置数值的前缀 | string \| v-slot | — | — |
+| suffix |设置数值的后缀 | string \| v-slot | — | — |
+| title | 数值的标题 | string \| v-slot | — | — |
+| value-style | 设置数值的样式 | object | — | — |
+| rate | 设置倍率 | number | — | 1000 |
### Statistic Slots
diff --git a/packages/statistic/src/main.vue b/packages/statistic/src/main.vue
index 1d7a6130c..2bf868f95 100644
--- a/packages/statistic/src/main.vue
+++ b/packages/statistic/src/main.vue
@@ -1,6 +1,6 @@
-
+
{{ title }}
@@ -8,15 +8,15 @@
-
-
+
+
{{ prefix }}
{{ disposeValue }}
-
+
{{ suffix }}
@@ -26,7 +26,7 @@