添加connect

This commit is contained in:
waliang.wang 2017-07-11 12:30:26 +08:00
parent 70c4942678
commit cf488810e7

View File

@ -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 './Login.scss'; import { connect } from 'react-redux'
import React, { Component } from 'react'; import PropTypes from 'prop-types'
import { Form, Button, Input, Icon, Checkbox } from 'antd'; import { Form, Button, Input, Icon, Checkbox } from 'antd'
import { BrowserRouter as Router, Route, Link } from 'react-router-dom';
const FormItem = Form.Item; const FormItem = Form.Item;
>>>>>>> 68828ebd3b3ac60015757711625048cef4b44165
@connect( @connect(
() => ({ () => ({
@ -18,42 +11,13 @@ const FormItem = Form.Item;
}) })
) )
class Login extends Component { class Login extends Component {
static propTypes = {
form: PropTypes.object,
}
handleSubmit = (e) => { handleSubmit = (e) => {
e.preventDefault(); e.preventDefault();
const form = this.props.form; 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()); // console.log(form.getFieldsValue());
form.validateFields((err, values) => { form.validateFields((err, values) => {
@ -62,6 +26,7 @@ class Login extends Component {
} }
}); });
} }
render() { render() {
const { getFieldDecorator } = this.props.form; const { getFieldDecorator } = this.props.form;
return ( return (
@ -91,7 +56,6 @@ class Login extends Component {
</FormItem> </FormItem>
</Form> </Form>
); );
>>>>>>> 68828ebd3b3ac60015757711625048cef4b44165
} }
} }