diff --git a/src/components/Login/demo/basic.md b/src/components/Login/demo/basic.md index 5fbd0ca25448f92e964538c545edaf07d595ff27..05475384c0878cec7c5c13bf7d0678e58d1599be 100644 --- a/src/components/Login/demo/basic.md +++ b/src/components/Login/demo/basic.md @@ -18,65 +18,94 @@ class LoginDemo extends React.Component { notice: '', type: 'tab2', autoLogin: true, - } + }; 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') { - this.setState({ - notice: '', - }, () => { - if (!err && (values.username !== 'admin' || values.password !== '888888')) { - setTimeout(() => { - this.setState({ - notice: 'The combination of username and password is incorrect!', - }); - }, 500); - } - }); + this.setState( + { + notice: '', + }, + () => { + if ( + !err && + (values.username !== 'admin' || values.password !== '888888') + ) { + setTimeout(() => { + this.setState({ + notice: + 'The combination of username and password is incorrect!', + }); + }, 500); + } + }, + ); } - } + }; onTabChange = (key) => { this.setState({ type: key, }); - } + }; changeAutoLogin = (e) => { this.setState({ autoLogin: e.target.checked, }); - } + }; render() { return ( - - - { - this.state.notice && - - } - - - - - - console.log('Get captcha!')} name="captcha" /> - -
- Keep me logged in - Forgot password -
- Login -
- Other login methods - - - - Register -
-
+
+ + + {this.state.notice && ( + + )} + + + + + + console.log('Get captcha!')} + name="captcha" + /> + +
+ + Keep me logged in + + + Forgot password + +
+ Login +
+ Other login methods + + + + + Register + +
+
+
); } } @@ -85,6 +114,10 @@ ReactDOM.render(, mountNode); ````