Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ant-design-pro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
duanledexianxianxian
ant-design-pro
Commits
189e6c5c
Commit
189e6c5c
authored
Aug 05, 2018
by
陈帅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Features: add buttonText on Login.Captcha
parent
11df3597
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
5 deletions
+14
-5
.gitignore
.gitignore
+1
-1
src/components/Login/LoginItem.js
src/components/Login/LoginItem.js
+6
-2
src/components/Login/index.d.ts
src/components/Login/index.d.ts
+1
-0
src/components/Login/index.en-US.md
src/components/Login/index.en-US.md
+1
-0
src/components/Login/index.zh-CN.md
src/components/Login/index.zh-CN.md
+1
-0
src/components/PageHeader/index.js
src/components/PageHeader/index.js
+4
-2
No files found.
.gitignore
View file @
189e6c5c
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
**
/node_modules
# roadhog-api-doc ignore
/src/utils/request-temp.js
_roadhog-api-doc
...
...
src/components/Login/LoginItem.js
View file @
189e6c5c
...
...
@@ -15,6 +15,10 @@ function generator({ defaultProps, defaultRules, type }) {
updateActive
:
PropTypes
.
func
,
};
static
defaultProps
=
{
buttonText
:
'
获取验证码
'
,
};
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
...
...
@@ -55,7 +59,7 @@ function generator({ defaultProps, defaultRules, type }) {
const
{
getFieldDecorator
}
=
form
;
const
options
=
{};
let
otherProps
=
{};
const
{
onChange
,
defaultValue
,
rules
,
name
,
...
restProps
}
=
this
.
props
;
const
{
onChange
,
defaultValue
,
buttonText
,
rules
,
name
,
...
restProps
}
=
this
.
props
;
const
{
count
}
=
this
.
state
;
options
.
rules
=
rules
||
defaultRules
;
if
(
onChange
)
{
...
...
@@ -82,7 +86,7 @@ function generator({ defaultProps, defaultRules, type }) {
size
=
"
large
"
onClick
=
{
this
.
onGetCaptcha
}
>
{
count
?
`
${
count
}
s`
:
'
获取验证码
'
}
{
count
?
`
${
count
}
s`
:
buttonText
}
<
/Button
>
<
/Col
>
<
/Row
>
...
...
src/components/Login/index.d.ts
View file @
189e6c5c
...
...
@@ -19,6 +19,7 @@ export interface LoginItemProps {
style
?:
React
.
CSSProperties
;
onGetCaptcha
?:
()
=>
void
;
placeholder
?:
string
;
buttonText
?:
React
.
ReactNode
;
}
export
class
LoginItem
extends
React
.
Component
<
LoginItemProps
,
any
>
{}
...
...
src/components/Login/index.en-US.md
View file @
189e6c5c
...
...
@@ -39,6 +39,7 @@ Apart from the above properties, Login.Username also support all properties of a
Property | Description | Type | Default
----|------|-----|------
onGetCaptcha | callback on getting a new Captcha | () => void | -
buttonText | text on getting a new Captcha | ReactNode | -
Apart from the above properties, _Login.Captcha_ support the same properties with _Login.UserName_.
...
...
src/components/Login/index.zh-CN.md
View file @
189e6c5c
...
...
@@ -40,6 +40,7 @@ rules | 校验规则,同 Form getFieldDecorator(id, options) 中 [option.rules
参数 | 说明 | 类型 | 默认值
----|------|-----|------
onGetCaptcha | 点击获取校验码的回调 | () => void | -
buttonText | 点击获取校验码的说明文字 | ReactNode | -
除上述属性以外,Login.Captcha 支持的属性与 Login.UserName 相同。
...
...
src/components/PageHeader/index.js
View file @
189e6c5c
...
...
@@ -221,14 +221,16 @@ export default class PageHeader extends PureComponent {
<
/div
>
<
/div
>
<
/div
>
{
(
tabList
&&
tabList
.
length
)
?
(
{
tabList
&&
tabList
.
length
?
(
<
Tabs
className
=
{
styles
.
tabs
}
{...
activeKeyProps
}
onChange
=
{
this
.
onChange
}
tabBarExtraContent
=
{
tabBarExtraContent
}
>
{
tabList
.
map
(
item
=>
<
TabPane
tab
=
{
item
.
tab
}
key
=
{
item
.
key
}
/>
)
}
{
tabList
.
map
(
item
=>
(
<
TabPane
tab
=
{
item
.
tab
}
key
=
{
item
.
key
}
/
>
))}
<
/Tabs
>
)
:
null
}
<
/div
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment