Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
京东前端
nutui-react
提交
d101950e
N
nutui-react
项目概览
京东前端
/
nutui-react
通知
0
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
N
nutui-react
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
d101950e
编写于
10月 25, 2021
作者:
_
__Oasis__
提交者:
GitHub
10月 25, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #746 from irisSong/nutui-react
Nutui react
上级
ac5451ce
f0aea8e6
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
12 addition
and
11 deletion
+12
-11
src/packages/cell/demo.tsx
src/packages/cell/demo.tsx
+2
-1
src/packages/cell/doc.md
src/packages/cell/doc.md
+1
-1
src/packages/price/demo.tsx
src/packages/price/demo.tsx
+4
-4
src/packages/price/doc.md
src/packages/price/doc.md
+3
-3
src/packages/price/price.tsx
src/packages/price/price.tsx
+2
-2
未找到文件。
src/packages/cell/demo.tsx
浏览文件 @
d101950e
import
React
,
{
MouseEvent
}
from
'
react
'
import
{
Cell
}
from
'
./cell
'
import
{
CellGroup
}
from
'
../cellgroup/cellgroup
'
import
{
Switch
}
from
'
../switch/switch
'
const
CellDemo
=
()
=>
{
const
testClick
=
(
event
:
React
.
MouseEvent
<
HTMLDivElement
,
globalThis
.
MouseEvent
>
)
=>
{
...
...
@@ -29,7 +30,7 @@ const CellDemo = () => {
</
CellGroup
>
<
CellGroup
title
=
"自定义右侧箭头区域"
>
<
Cell
title
=
"Switch"
extra
=
{
<
div
>
这里是switch组件
</
div
>
}
></
Cell
>
<
Cell
title
=
"Switch"
extra
=
{
<
Switch
checked
=
{
true
}
></
Switch
>
}
></
Cell
>
</
CellGroup
>
<
h2
>
展示图标
</
h2
>
<
Cell
title
=
"姓名"
icon
=
"my"
desc
=
"张三"
isLink
=
{
true
}
></
Cell
>
...
...
src/packages/cell/doc.md
浏览文件 @
d101950e
...
...
@@ -46,7 +46,7 @@ const testClick = (event: React.MouseEvent<HTMLDivElement, globalThis.MouseEvent
```
tsx
<
CellGroup
title
=
"自定义右侧箭头区域"
>
<
Cell
title
=
"Switch"
extra
=
{
<
div
>
这里是switch组件
</
div
>
}
></
Cell
>
<
Cell
title
=
"Switch"
extra
=
{
<
Switch
checked
=
{
true
}
></
Switch
>
}
></
Cell
>
</
CellGroup
>
```
...
...
src/packages/price/demo.tsx
浏览文件 @
d101950e
...
...
@@ -17,19 +17,19 @@ const PriceDemo = () => {
<
div
className
=
"demo"
>
<
h2
>
基本用法
</
h2
>
<
Cell
>
<
Price
price
=
{
0
}
need
-
s
ymbol
=
{
false
}
thousands
=
{
true
}
/>
<
Price
price
=
{
0
}
need
S
ymbol
=
{
false
}
thousands
=
{
true
}
/>
</
Cell
>
<
h2
>
有人民币符号,无千位分隔
</
h2
>
<
Cell
>
<
Price
price
=
{
10010.01
}
need
-
s
ymbol
=
{
true
}
thousands
=
{
false
}
/>
<
Price
price
=
{
10010.01
}
need
S
ymbol
=
{
true
}
thousands
=
{
false
}
/>
</
Cell
>
<
h2
>
带人民币符号,有千位分隔,保留小数点后三位
</
h2
>
<
Cell
>
<
Price
price
=
{
15213.1221
}
decimal
-
digits
=
{
3
}
need
-
s
ymbol
=
{
true
}
thousands
=
{
true
}
/>
<
Price
price
=
{
15213.1221
}
decimal
Digits
=
{
3
}
needS
ymbol
=
{
true
}
thousands
=
{
true
}
/>
</
Cell
>
<
h2
>
异步随机变更
</
h2
>
<
Cell
>
<
Price
price
=
{
price
}
decimal
-
digits
=
{
3
}
need
-
s
ymbol
=
{
true
}
thousands
=
{
true
}
/>
<
Price
price
=
{
price
}
decimal
Digits
=
{
3
}
needS
ymbol
=
{
true
}
thousands
=
{
true
}
/>
</
Cell
>
</
div
>
)
...
...
src/packages/price/doc.md
浏览文件 @
d101950e
...
...
@@ -11,19 +11,19 @@
### 基本用法
```
tsx
<
Price
price
=
{
0
}
need
-
s
ymbol
=
{
false
}
thousands
=
{
true
}
/>
<
Price
price
=
{
0
}
need
S
ymbol
=
{
false
}
thousands
=
{
true
}
/>
```
### 有人民币符号,无千位分隔
```
tsx
<
Price
price
=
{
10010.01
}
need
-
s
ymbol
=
{
true
}
thousands
=
{
false
}
/>
<
Price
price
=
{
10010.01
}
need
S
ymbol
=
{
true
}
thousands
=
{
false
}
/>
```
### 带人民币符号,有千位分隔,保留小数点后三位
```
tsx
<
Price
price
=
{
15213.1221
}
decimal
-
digits
=
{
3
}
need
-
s
ymbol
=
{
true
}
thousands
=
{
true
}
/>
<
Price
price
=
{
15213.1221
}
decimal
Digits
=
{
3
}
needS
ymbol
=
{
true
}
thousands
=
{
true
}
/>
```
### 异步随机变更
...
...
src/packages/price/price.tsx
浏览文件 @
d101950e
...
...
@@ -20,7 +20,7 @@ export const Price: FunctionComponent<Partial<PriceProps>> = (props) => {
const
{
price
,
needSymbol
,
symbol
,
decimalDigits
,
thousands
}
=
{
...
defaultProps
,
...
props
}
const
b
=
bem
(
'
price
'
)
const
showSymbol
=
()
=>
{
return
{
__html
:
(
props
.
needSymbol
?
props
.
symbol
:
''
)
||
''
}
return
{
__html
:
(
needSymbol
?
symbol
:
''
)
||
''
}
}
const
checkPoint
=
(
price
:
string
|
number
)
=>
{
return
String
(
price
).
indexOf
(
'
.
'
)
>
0
...
...
@@ -35,7 +35,7 @@ export const Price: FunctionComponent<Partial<PriceProps>> = (props) => {
}
else
{
num
=
num
.
toString
()
}
if
(
props
.
thousands
)
{
if
(
thousands
)
{
return
(
num
||
0
).
toString
().
replace
(
/
(\d)(?=(?:\d{3})
+$
)
/g
,
'
$1,
'
)
}
else
{
return
num
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录