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
ca6453a3
Commit
ca6453a3
authored
Mar 26, 2019
by
ιεΈ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix: fix #3576, add max-width
parent
e6fe4979
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
79 additions
and
46 deletions
+79
-46
src/components/Login/demo/basic.md
src/components/Login/demo/basic.md
+79
-46
No files found.
src/components/Login/demo/basic.md
View file @
ca6453a3
...
@@ -18,65 +18,94 @@ class LoginDemo extends React.Component {
...
@@ -18,65 +18,94 @@ class LoginDemo extends React.Component {
notice
:
''
,
notice
:
''
,
type
:
'
tab2
'
,
type
:
'
tab2
'
,
autoLogin
:
true
,
autoLogin
:
true
,
}
}
;
onSubmit
=
(
err
,
values
)
=>
{
onSubmit
=
(
err
,
values
)
=>
{
console
.
log
(
'
value collected ->
'
,
{
...
values
,
autoLogin
:
this
.
state
.
autoLogin
});
console
.
log
(
'
value collected ->
'
,
{
...
values
,
autoLogin
:
this
.
state
.
autoLogin
,
});
if
(
this
.
state
.
type
===
'
tab1
'
)
{
if
(
this
.
state
.
type
===
'
tab1
'
)
{
this
.
setState
({
this
.
setState
(
notice
:
''
,
{
},
()
=>
{
notice
:
''
,
if
(
!
err
&&
(
values
.
username
!==
'
admin
'
||
values
.
password
!==
'
888888
'
))
{
},
setTimeout
(()
=>
{
()
=>
{
this
.
setState
({
if
(
notice
:
'
The combination of username and password is incorrect!
'
,
!
err
&&
});
(
values
.
username
!==
'
admin
'
||
values
.
password
!==
'
888888
'
)
},
500
);
)
{
}
setTimeout
(()
=>
{
});
this
.
setState
({
notice
:
'
The combination of username and password is incorrect!
'
,
});
},
500
);
}
},
);
}
}
}
}
;
onTabChange
=
(
key
)
=>
{
onTabChange
=
(
key
)
=>
{
this
.
setState
({
this
.
setState
({
type
:
key
,
type
:
key
,
});
});
}
}
;
changeAutoLogin
=
(
e
)
=>
{
changeAutoLogin
=
(
e
)
=>
{
this
.
setState
({
this
.
setState
({
autoLogin
:
e
.
target
.
checked
,
autoLogin
:
e
.
target
.
checked
,
});
});
}
}
;
render
()
{
render
()
{
return
(
return
(
<
Login
<
div
className
=
"login-warp"
>
defaultActiveKey
=
{
this
.
state
.
type
}
<
Login
onTabChange
=
{
this
.
onTabChange
}
defaultActiveKey
=
{
this
.
state
.
type
}
onSubmit
=
{
this
.
onSubmit
}
onTabChange
=
{
this
.
onTabChange
}
>
onSubmit
=
{
this
.
onSubmit
}
<
Tab
key
=
"tab1"
tab
=
"Account"
>
>
{
<
Tab
key
=
"tab1"
tab
=
"Account"
>
this
.
state
.
notice
&&
{
this
.
state
.
notice
&&
(
<
Alert
style
=
{
{
marginBottom
:
24
}
}
message
=
{
this
.
state
.
notice
}
type
=
"error"
showIcon
closable
/>
<
Alert
}
style
=
{
{
marginBottom
:
24
}
}
<
UserName
name
=
"username"
/>
message
=
{
this
.
state
.
notice
}
<
Password
name
=
"password"
/>
type
=
"error"
</
Tab
>
showIcon
<
Tab
key
=
"tab2"
tab
=
"Mobile"
>
closable
<
Mobile
name
=
"mobile"
/>
/>
<
Captcha
onGetCaptcha
=
{
()
=>
console
.
log
(
'
Get captcha!
'
)
}
name
=
"captcha"
/>
)
}
</
Tab
>
<
UserName
name
=
"username"
/>
<
div
>
<
Password
name
=
"password"
/>
<
Checkbox
checked
=
{
this
.
state
.
autoLogin
}
onChange
=
{
this
.
changeAutoLogin
}
>
Keep me logged in
</
Checkbox
>
</
Tab
>
<
a
style
=
{
{
float
:
'
right
'
}
}
href
=
""
>
Forgot password
</
a
>
<
Tab
key
=
"tab2"
tab
=
"Mobile"
>
</
div
>
<
Mobile
name
=
"mobile"
/>
<
Submit
>
Login
</
Submit
>
<
Captcha
<
div
>
onGetCaptcha
=
{
()
=>
console
.
log
(
'
Get captcha!
'
)
}
Other login methods
name
=
"captcha"
<
span
className
=
"icon icon-alipay"
/>
/>
<
span
className
=
"icon icon-taobao"
/>
</
Tab
>
<
span
className
=
"icon icon-weibo"
/>
<
div
>
<
a
style
=
{
{
float
:
'
right
'
}
}
href
=
""
>
Register
</
a
>
<
Checkbox
</
div
>
checked
=
{
this
.
state
.
autoLogin
}
</
Login
>
onChange
=
{
this
.
changeAutoLogin
}
>
Keep me logged in
</
Checkbox
>
<
a
style
=
{
{
float
:
'
right
'
}
}
href
=
""
>
Forgot password
</
a
>
</
div
>
<
Submit
>
Login
</
Submit
>
<
div
>
Other login methods
<
span
className
=
"icon icon-alipay"
/>
<
span
className
=
"icon icon-taobao"
/>
<
span
className
=
"icon icon-weibo"
/>
<
a
style
=
{
{
float
:
'
right
'
}
}
href
=
""
>
Register
</
a
>
</
div
>
</
Login
>
</
div
>
);
);
}
}
}
}
...
@@ -85,6 +114,10 @@ ReactDOM.render(<LoginDemo />, mountNode);
...
@@ -85,6 +114,10 @@ ReactDOM.render(<LoginDemo />, mountNode);
````
````
<style>
<style>
#scaffold-src-components-Login-demo-basic .login-warp{
max-width: 360px;
margin: auto;
}
#scaffold-src-components-Login-demo-basic .icon {
#scaffold-src-components-Login-demo-basic .icon {
display: inline-block;
display: inline-block;
width: 24px;
width: 24px;
...
...
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