Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
京东前端
nutui
提交
2a89d684
N
nutui
项目概览
京东前端
/
nutui
通知
37
Star
4
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
N
nutui
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
2a89d684
编写于
10月 29, 2021
作者:
richard_1015
1
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
upd(price): 优化官网展示 demo
上级
c380ac52
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
71 addition
and
40 deletion
+71
-40
src/packages/__VUE/price/demo.vue
src/packages/__VUE/price/demo.vue
+20
-15
src/packages/__VUE/price/doc.md
src/packages/__VUE/price/doc.md
+22
-11
src/packages/__VUE/price/index.taro.vue
src/packages/__VUE/price/index.taro.vue
+1
-1
src/packages/__VUE/price/index.vue
src/packages/__VUE/price/index.vue
+1
-1
src/packages/styles/variables.scss
src/packages/styles/variables.scss
+7
-7
src/sites/mobile-taro/vue/src/base/pages/price/index.vue
src/sites/mobile-taro/vue/src/base/pages/price/index.vue
+20
-5
未找到文件。
src/packages/__VUE/price/demo.vue
浏览文件 @
2a89d684
<
template
>
<div
class=
"demo"
>
<h2>
基本用法
</h2>
<nut-cell-group
title=
"基本用法 small normal large"
>
<nut-cell>
<nut-price
:price=
"0"
size=
"small"
:need-symbol=
"true"
:thousands=
"true"
/>
</nut-cell>
<nut-cell>
<nut-price
:price=
"0"
size=
"normal"
:need-symbol=
"true"
:thousands=
"true"
/>
</nut-cell>
<nut-cell>
<nut-price
:price=
"0"
size=
"large"
:need-symbol=
"true"
:thousands=
"true"
/>
</nut-cell>
</nut-cell-group>
<h2>
不保留小数
</h2>
<nut-cell>
<nut-price
:price=
"0"
:need-symbol=
"false"
:thousands=
"true"
/>
<nut-price
:price=
"8888"
decimal-digits=
"0"
size=
"normal"
:need-symbol=
"true"
:thousands=
"true"
/>
</nut-cell>
<h2>
调整 symbol 符号位置
</h2>
<nut-cell>
<nut-price
:price=
"8888.01"
position=
"after"
symbol=
"元"
size=
"normal"
:need-symbol=
"true"
:thousands=
"true"
/>
</nut-cell>
<h2>
有人民币符号,无千位分隔
</h2>
<nut-cell>
<nut-price
:price=
"10010.01"
:need-symbol=
"true"
:thousands=
"false"
/>
<nut-price
:price=
"10010.01"
size=
"normal"
:need-symbol=
"true"
:thousands=
"false"
/>
</nut-cell>
<h2>
带人民币符号,有千位分隔,保留小数点后三位
</h2>
<nut-cell>
<nut-price
:price=
"15213.1221"
:decimal-digits=
"3"
:need-symbol=
"true"
:thousands=
"true"
/>
<nut-price
:price=
"15213.1221"
size=
"normal"
:decimal-digits=
"3"
:need-symbol=
"true"
:thousands=
"true"
/>
</nut-cell>
<h2>
异步随机变更
</h2>
<nut-cell>
<nut-price
:price=
"price"
:decimal-digits=
"3"
:need-symbol=
"true"
:thousands=
"true"
/>
<nut-price
:price=
"price"
size=
"normal"
:decimal-digits=
"3"
:need-symbol=
"true"
:thousands=
"true"
/>
</nut-cell>
</div>
</
template
>
...
...
src/packages/__VUE/price/doc.md
浏览文件 @
2a89d684
...
...
@@ -19,10 +19,21 @@ app.use(Price);
```
### 基本用法
### 基本用法
small normal large
```
html
<nut-price
:price=
"1010"
:need-symbol=
"false"
:thousands=
"true"
/>
<nut-price
:price=
"0"
size=
"small"
:need-symbol=
"false"
:thousands=
"true"
/>
<nut-price
:price=
"0"
size=
"normal"
:need-symbol=
"false"
:thousands=
"true"
/>
<nut-price
:price=
"0"
size=
"large"
:need-symbol=
"false"
:thousands=
"true"
/>
```
### 不保留小数
```
html
<nut-price
:price=
"8888"
decimal-digits=
"0"
size=
"normal"
:need-symbol=
"true"
:thousands=
"true"
/>
```
### 调整 symbol 符号位置
```
html
<nut-price
:price=
"8888.01"
position=
"after"
symbol=
"元"
size=
"normal"
:need-symbol=
"true"
:thousands=
"true"
/>
```
### 有人民币符号,无千位分隔
...
...
@@ -55,12 +66,12 @@ setup() {
### Prop
| 字段 | 说明 | 类型 | 默认值 |
|----------------|--------------------------|---------|--------|
| price | 价格数量 | Number | 0 |
| need-symbol | 是否需要加上 symbol 符号 | Boolean | true |
| symbol | 符号类型 | String |
¥
|
| decimal-digits | 小数位位数 | Number | 2 |
| thousands | 是否按照千分号形式显示 | Boolean | false |
| position | 符号显示在(价格)前或者后(before、after) | String | before |
| size | 价格尺寸(large、normal、small) | String | normal |
\ No newline at end of file
| 字段 | 说明 | 类型 | 默认值 |
|----------------|-----------------------------------------|---------|--------|
| price | 价格数量 | Number | 0 |
| need-symbol | 是否需要加上 symbol 符号 | Boolean | true |
| symbol | 符号类型 | String |
¥
|
| decimal-digits | 小数位位数 | Number | 2 |
| thousands | 是否按照千分号形式显示 | Boolean | false |
| position | 符号显示在(价格)前或者后(before、after) | String | before |
| size | 价格尺寸(large、normal、small) | String | large |
\ No newline at end of file
src/packages/__VUE/price/index.taro.vue
浏览文件 @
2a89d684
...
...
@@ -57,7 +57,7 @@ export default create({
},
size
:
{
type
:
String
,
default
:
'
normal
'
default
:
'
large
'
}
},
...
...
src/packages/__VUE/price/index.vue
浏览文件 @
2a89d684
...
...
@@ -55,7 +55,7 @@ export default create({
},
size
:
{
type
:
String
,
default
:
'
normal
'
default
:
'
large
'
}
},
...
...
src/packages/styles/variables.scss
浏览文件 @
2a89d684
...
...
@@ -150,19 +150,19 @@ $shortpsd-error: rgba(242, 39, 12, 1) !default;
$shortpsd-forget
:
rgba
(
128
,
128
,
128
,
1
)
!
default
;
//large price
$price-symbol-big-size
:
1
6
px
!
default
;
$price-big-size
:
30
px
!
default
;
$price-symbol-big-size
:
1
8
px
!
default
;
$price-big-size
:
24
px
!
default
;
$price-decimal-big-size
:
18px
!
default
;
//normal price
$price-symbol-medium-size
:
1
3
px
!
default
;
$price-symbol-medium-size
:
1
4
px
!
default
;
$price-medium-size
:
16px
!
default
;
$price-decimal-medium-size
:
1
3
px
!
default
;
$price-decimal-medium-size
:
1
4
px
!
default
;
// small price
$price-symbol-small-size
:
1
1
px
!
default
;
$price-small-size
:
1
4
.
2px
!
default
;
$price-decimal-small-size
:
1
4
.2
px
!
default
;
$price-symbol-small-size
:
1
0
px
!
default
;
$price-small-size
:
12px
!
default
;
$price-decimal-small-size
:
1
0
px
!
default
;
//avatar
$avatar-square
:
5px
!
default
;
...
...
src/sites/mobile-taro/vue/src/base/pages/price/index.vue
浏览文件 @
2a89d684
<
template
>
<div
class=
"demo"
>
<h2>
基本用法
¥
</h2>
<nut-cell-group
title=
"基本用法 small normal large"
>
<nut-cell>
<nut-price
:price=
"0"
size=
"small"
:need-symbol=
"true"
:thousands=
"true"
/>
</nut-cell>
<nut-cell>
<nut-price
:price=
"0"
size=
"normal"
:need-symbol=
"true"
:thousands=
"true"
/>
</nut-cell>
<nut-cell>
<nut-price
:price=
"0"
size=
"large"
:need-symbol=
"true"
:thousands=
"true"
/>
</nut-cell>
</nut-cell-group>
<h2>
不保留小数
</h2>
<nut-cell>
<nut-price
:price=
"1010"
:need-symbol=
"false"
:thousands=
"true"
/>
<nut-price
:price=
"8888"
decimal-digits=
"0"
size=
"normal"
:need-symbol=
"true"
:thousands=
"true"
/>
</nut-cell>
<h2>
调整 symbol 符号位置
</h2>
<nut-cell>
<nut-price
:price=
"8888.01"
position=
"after"
symbol=
"元"
size=
"normal"
:need-symbol=
"true"
:thousands=
"true"
/>
</nut-cell>
<h2>
有人民币符号,无千位分隔
</h2>
<nut-cell>
<nut-price
:price=
"10010.01"
:need-symbol=
"true"
:thousands=
"false"
/>
<nut-price
:price=
"10010.01"
size=
"normal"
:need-symbol=
"true"
:thousands=
"false"
/>
</nut-cell>
<h2>
带人民币符号,有千位分隔,保留小数点后三位
</h2>
<nut-cell>
<nut-price
:price=
"15213.1221"
:decimal-digits=
"2
"
:need-symbol=
"true"
:thousands=
"true"
/>
<nut-price
:price=
"15213.1221"
size=
"normal"
:decimal-digits=
"3
"
:need-symbol=
"true"
:thousands=
"true"
/>
</nut-cell>
<h2>
异步随机变更
</h2>
<nut-cell>
<nut-price
:price=
"price"
:decimal-digits=
"3"
:need-symbol=
"fals
e"
:thousands=
"true"
/>
<nut-price
:price=
"price"
size=
"normal"
:decimal-digits=
"3"
:need-symbol=
"tru
e"
:thousands=
"true"
/>
</nut-cell>
</div>
</
template
>
...
...
richard_1015
@u011978868
mentioned in commit
14e66110
·
1月 07, 2022
mentioned in commit
14e66110
mentioned in commit 14e6611022dee3b70e36157223be28b71a4207dd
开关提交列表
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录