mirror of
https://github.com/YMFE/yapi.git
synced 2024-12-15 05:10:47 +08:00
添加connect
This commit is contained in:
parent
70c4942678
commit
cf488810e7
@ -1,16 +1,9 @@
|
||||
<<<<<<< HEAD
|
||||
import React, { Component } from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import { connect } from 'react-redux'
|
||||
import { Button, Input, Icon, Checkbox } from 'antd'
|
||||
import './Login.scss'
|
||||
=======
|
||||
import './Login.scss';
|
||||
import React, { Component } from 'react';
|
||||
import { Form, Button, Input, Icon, Checkbox } from 'antd';
|
||||
import { BrowserRouter as Router, Route, Link } from 'react-router-dom';
|
||||
import React, { Component } from 'react'
|
||||
import { connect } from 'react-redux'
|
||||
import PropTypes from 'prop-types'
|
||||
import { Form, Button, Input, Icon, Checkbox } from 'antd'
|
||||
const FormItem = Form.Item;
|
||||
>>>>>>> 68828ebd3b3ac60015757711625048cef4b44165
|
||||
|
||||
@connect(
|
||||
() => ({
|
||||
@ -18,42 +11,13 @@ const FormItem = Form.Item;
|
||||
})
|
||||
)
|
||||
class Login extends Component {
|
||||
static propTypes = {
|
||||
form: PropTypes.object,
|
||||
}
|
||||
|
||||
handleSubmit = (e) => {
|
||||
e.preventDefault();
|
||||
const form = this.props.form;
|
||||
|
||||
<<<<<<< HEAD
|
||||
static propTypes = {
|
||||
value: PropTypes.string,
|
||||
per: PropTypes.string,
|
||||
}
|
||||
|
||||
render () {
|
||||
return (
|
||||
<acticle className="login-main">
|
||||
<span>{this.props.value}{this.props.per}</span>
|
||||
<section className="login-box">
|
||||
<div className="content">
|
||||
<Input
|
||||
size="large"
|
||||
placeholder="Username"
|
||||
prefix={<Icon type="user" style={{ fontSize: 16 }} />} />
|
||||
|
||||
<Input
|
||||
size="large"
|
||||
type="password"
|
||||
placeholder="Password"
|
||||
prefix={<Icon type="lock" style={{ fontSize: 16 }} />} />
|
||||
|
||||
<div className="login">
|
||||
<Checkbox>记住密码</Checkbox>
|
||||
<Button type="primary">登录</Button>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</acticle>
|
||||
)
|
||||
=======
|
||||
// 获取全部组件的值
|
||||
// console.log(form.getFieldsValue());
|
||||
form.validateFields((err, values) => {
|
||||
@ -62,6 +26,7 @@ class Login extends Component {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
const { getFieldDecorator } = this.props.form;
|
||||
return (
|
||||
@ -91,7 +56,6 @@ class Login extends Component {
|
||||
</FormItem>
|
||||
</Form>
|
||||
);
|
||||
>>>>>>> 68828ebd3b3ac60015757711625048cef4b44165
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user