Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
京东前端
nutui-react
提交
541e3df0
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,发现更多精彩内容 >>
未验证
提交
541e3df0
编写于
2月 20, 2023
作者:
K
Kason Yang
提交者:
GitHub
2月 20, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(shortpassword): 支持自动聚焦 (#693)
上级
2a18fb5c
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
48 addition
and
0 deletion
+48
-0
src/packages/shortpassword/demo.taro.tsx
src/packages/shortpassword/demo.taro.tsx
+18
-0
src/packages/shortpassword/demo.tsx
src/packages/shortpassword/demo.tsx
+18
-0
src/packages/shortpassword/doc.en-US.md
src/packages/shortpassword/doc.en-US.md
+1
-0
src/packages/shortpassword/doc.md
src/packages/shortpassword/doc.md
+1
-0
src/packages/shortpassword/doc.taro.md
src/packages/shortpassword/doc.taro.md
+1
-0
src/packages/shortpassword/doc.zh-TW.md
src/packages/shortpassword/doc.zh-TW.md
+1
-0
src/packages/shortpassword/shortpassword.taro.tsx
src/packages/shortpassword/shortpassword.taro.tsx
+4
-0
src/packages/shortpassword/shortpassword.tsx
src/packages/shortpassword/shortpassword.tsx
+4
-0
未找到文件。
src/packages/shortpassword/demo.taro.tsx
浏览文件 @
541e3df0
...
...
@@ -29,6 +29,7 @@ const ShortPasswordDemo = () => {
const
[
visible2
,
setVisible2
]
=
useState
(
false
)
const
[
visible3
,
setVisible3
]
=
useState
(
false
)
const
[
visible4
,
setVisible4
]
=
useState
(
false
)
const
[
visible5
,
setVisible5
]
=
useState
(
false
)
const
[
value
,
setValue
]
=
useState
<
string
|
number
>
(
''
)
const
change
=
(
value
:
number
|
string
)
=>
{
setValue
(
value
)
...
...
@@ -129,6 +130,23 @@ const ShortPasswordDemo = () => {
SetShow
(
false
)
}
}
/>
<
h2
>
自动聚焦
</
h2
>
<
Cell
title
=
"自动聚焦"
isLink
onClick
=
{
()
=>
{
setVisible5
(
true
)
}
}
/>
<
ShortPassword
visible
=
{
visible5
}
modelValue
=
{
value
}
onClose
=
{
()
=>
{
setVisible5
(
false
)
setValue
(
''
)
}
}
autoFocus
/>
</
div
>
</>
)
...
...
src/packages/shortpassword/demo.tsx
浏览文件 @
541e3df0
...
...
@@ -29,6 +29,7 @@ const ShortPasswordDemo = () => {
const
[
visible2
,
setVisible2
]
=
useState
(
false
)
const
[
visible3
,
setVisible3
]
=
useState
(
false
)
const
[
visible4
,
setVisible4
]
=
useState
(
false
)
const
[
visible5
,
setVisible5
]
=
useState
(
false
)
const
[
value
,
setValue
]
=
useState
<
string
|
number
>
(
''
)
const
change
=
(
value
:
number
|
string
)
=>
{
console
.
log
(
value
)
...
...
@@ -109,6 +110,23 @@ const ShortPasswordDemo = () => {
}
}
onTips
=
{
()
=>
onTips
()
}
/>
<
h2
>
自动聚焦
</
h2
>
<
Cell
title
=
"自动聚焦"
isLink
onClick
=
{
()
=>
{
setVisible5
(
true
)
}
}
/>
<
ShortPassword
visible
=
{
visible5
}
modelValue
=
{
value
}
onClose
=
{
()
=>
{
setVisible5
(
false
)
setValue
(
''
)
}
}
autoFocus
/>
</
div
>
)
}
...
...
src/packages/shortpassword/doc.en-US.md
浏览文件 @
541e3df0
...
...
@@ -191,6 +191,7 @@ export default App;
| noButton | whether to hide the bottom button | Boolean | true |
| length | ShortPassword lenght The value is 4~6 | String|Number | 6 |
| errorMsg | Error message | String | '' |
| autoFocus | Be focused when ShortPassword is displayed | Boolean | false |
### Events
...
...
src/packages/shortpassword/doc.md
浏览文件 @
541e3df0
...
...
@@ -189,6 +189,7 @@ export default App;
| noButton | 是否隐藏底部按钮 | Boolean | true |
| length | 密码长度,取值为4~6 | String|Number | 6 |
| errorMsg | 错误信息提示 | String | '' |
| autoFocus | 自动聚焦 | Boolean | false |
### Events
...
...
src/packages/shortpassword/doc.taro.md
浏览文件 @
541e3df0
...
...
@@ -188,6 +188,7 @@ export default App;
| noButton | 是否隐藏底部按钮 | Boolean | true |
| length | 密码长度,取值为4~6 | String|Number | 6 |
| errorMsg | 错误信息提示 | String | '' |
| autoFocus | 自动聚焦 | Boolean | false |
### Events
...
...
src/packages/shortpassword/doc.zh-TW.md
浏览文件 @
541e3df0
...
...
@@ -189,6 +189,7 @@ export default App;
| noButton | 是否隱藏底部按鈕 | Boolean | true |
| length | 密碼長度,取值為4~6 | String|Number | 6 |
| errorMsg | 錯誤信息提示 | String | '' |
| autoFocus | 自動聚焦 | Boolean | false |
### Events
...
...
src/packages/shortpassword/shortpassword.taro.tsx
浏览文件 @
541e3df0
...
...
@@ -24,6 +24,7 @@ export interface ShortPasswordProps extends BasicComponent {
length
:
string
|
number
className
:
string
style
?:
CSSProperties
autoFocus
?:
boolean
onChange
:
(
value
:
string
|
number
)
=>
void
onOk
:
(
value
:
string
|
number
)
=>
void
onCancel
:
()
=>
void
...
...
@@ -44,6 +45,7 @@ const defaultProps = {
closeOnClickOverlay
:
true
,
length
:
6
,
// 1~6
className
:
''
,
autoFocus
:
false
,
onChange
:
(
value
:
number
|
string
)
=>
{},
onOk
:
(
value
:
number
|
string
)
=>
{},
onCancel
:
()
=>
{},
...
...
@@ -76,6 +78,7 @@ export const ShortPassword: FunctionComponent<
onComplete
,
iconClassPrefix
,
iconFontClassName
,
autoFocus
,
...
reset
}
=
props
const
b
=
bem
(
'
shortpassword
'
)
...
...
@@ -163,6 +166,7 @@ export const ShortPassword: FunctionComponent<
style
=
{
systemStyle
()
}
maxLength
=
{
6
}
value
=
{
inputValue
}
autoFocus
=
{
autoFocus
}
onChange
=
{
(
e
)
=>
changeValue
(
e
)
}
/>
<
div
className
=
{
b
(
'
input-site
'
)
}
/>
...
...
src/packages/shortpassword/shortpassword.tsx
浏览文件 @
541e3df0
...
...
@@ -24,6 +24,7 @@ export interface ShortPasswordProps extends BasicComponent {
length
:
string
|
number
className
:
string
style
?:
CSSProperties
autoFocus
?:
boolean
onChange
:
(
value
:
string
|
number
)
=>
void
onOk
:
(
value
:
string
|
number
)
=>
void
onCancel
:
()
=>
void
...
...
@@ -44,6 +45,7 @@ const defaultProps = {
closeOnClickOverlay
:
true
,
length
:
6
,
// 1~6
className
:
''
,
autoFocus
:
false
,
onChange
:
(
value
:
number
|
string
)
=>
{},
onOk
:
(
value
:
number
|
string
)
=>
{},
onCancel
:
()
=>
{},
...
...
@@ -76,6 +78,7 @@ export const ShortPassword: FunctionComponent<
onComplete
,
iconClassPrefix
,
iconFontClassName
,
autoFocus
,
...
reset
}
=
props
const
b
=
bem
(
'
shortpassword
'
)
...
...
@@ -163,6 +166,7 @@ export const ShortPassword: FunctionComponent<
style
=
{
systemStyle
()
}
maxLength
=
{
6
}
value
=
{
inputValue
}
autoFocus
=
{
autoFocus
}
onChange
=
{
(
e
)
=>
changeValue
(
e
)
}
/>
<
div
className
=
{
b
(
'
input-site
'
)
}
/>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录