From 96b7e634b5bdcc32cd7aee0d8a489a02414b2293 Mon Sep 17 00:00:00 2001
From: Aaron.Liu <427787340@qq.com>
Date: Sun, 22 Mar 2020 17:51:07 +0800
Subject: [PATCH] [新增] 金融数字
---
examples/router/routes.js | 6 ++++++
examples/views/docs/component/amount.md | 136 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
packages/amount/index.css | 3 +++
packages/amount/index.vue | 400 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 545 insertions(+), 0 deletions(-)
create mode 100644 examples/views/docs/component/amount.md
create mode 100644 packages/amount/index.css
create mode 100644 packages/amount/index.vue
diff --git a/examples/router/routes.js b/examples/router/routes.js
index d65456d..353b5cd 100644
--- a/examples/router/routes.js
+++ b/examples/router/routes.js
@@ -76,6 +76,12 @@ const _components = [
meta: { title: 'Tag 标签' },
component: () => import('@/views/docs/component/tag.md'),
},
+ {
+ path: 'amount',
+ name: 'amount',
+ meta: { title: 'Amount 金融数字' },
+ component: () => import('@/views/docs/component/amount.md'),
+ },
]
},
{
diff --git a/examples/views/docs/component/amount.md b/examples/views/docs/component/amount.md
new file mode 100644
index 0000000..399af4f
--- /dev/null
+++ b/examples/views/docs/component/amount.md
@@ -0,0 +1,136 @@
+# Amount 金融数字
+
+金融数字,一般用于金额,数量等。参考 Mand Mobile - Amount
+
+## 基础用法
+
+::: snippet 设置`value`为基本数值,数值必须是`Number`类型
+
+```html
+
+
+
+
+
+```
+
+:::
+
+## 千分位分隔符
+
+::: snippet 设置`has-separator`显示分隔符
+```html
+
+
+
+
+
+```
+
+:::
+
+## 变化动效
+
+::: snippet 设置`transition`使用动效,设置`duration`改变数字变化动画时长
+```html
+
+
+
+
+
+
+
+
+```
+
+:::
+
+## 大写中文
+
+::: snippet 设置`is-capital`显示大写中文
+```html
+
+
+
+
+
+```
+
+:::
+
+## 前缀
+
+::: snippet 设置`prefix`显示前缀,也可以通过`prefix 插槽`自定义前缀
+```html
+
+
+
+
+
+```
+
+:::
+
+## API
+
+## Attribute 属性
+
+参数|说明|类型|默认值|备注
+-|-|-|-|-
+value|数值|Number|0|-
+precision|数字精度|Number|2|小数点后保留几位
+is-round-up|数字精度取舍是否四舍五入|Boolean|true|-
+has-separator|数字是否有千位分隔符|Boolean|false|-
+separator|数字千位分隔符|String|,|-
+is-capital|数字是否转换为大写中文|Boolean|false|-
+transition|数字变化是否使用动画|Boolean|false|-
+duration|数字变化动画时长|Number|1000|单位ms
+prefix|前缀|String|-|-
\ No newline at end of file
diff --git a/packages/amount/index.css b/packages/amount/index.css
new file mode 100644
index 0000000..bb6069e
--- /dev/null
+++ b/packages/amount/index.css
@@ -0,0 +1,3 @@
+.zui-amount.numerical {
+ font-family: DINPro-Medium, DIN Alternate, "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;
+}
\ No newline at end of file
diff --git a/packages/amount/index.vue b/packages/amount/index.vue
new file mode 100644
index 0000000..7a537e0
--- /dev/null
+++ b/packages/amount/index.vue
@@ -0,0 +1,400 @@
+
+
+
+ {{ prefix }}
+ {{ formatValue | doPrecision(legalPrecision, isRoundUp) | doFormat(hasSeparator, separator) }}
+ {{ formatValue | doPrecision(4, isRoundUp) | doCapital }}
+
+
+
+
+
+
\ No newline at end of file
--
libgit2 0.21.0