@@ -3,7 +3,7 @@ import * as React from "react"
33import { Props , State } from './new-store.type'
44import * as S from '../menu.style'
55import { PureComponent } from '../../../utils/react-helper'
6- import { Form , Button , Input } from 'antd'
6+ import { Form , Button , Input , Switch } from 'antd'
77
88const FormItem = Form . Item
99
@@ -45,20 +45,32 @@ class FormComponent extends PureComponent<Props, State> {
4545 < Form onSubmit = { this . handleSubmit } >
4646 < FormItem
4747 { ...formItemLayout }
48- label = "Path "
48+ label = "Name "
4949 >
50- { this . props . form . getFieldDecorator ( 'path ' , {
51- initialValue : 'about ' ,
50+ { this . props . form . getFieldDecorator ( 'name ' , {
51+ initialValue : 'application ' ,
5252 rules : [ {
53- type : 'string' , message : 'Path must be string!' ,
53+ type : 'string' , message : 'Name must be string!' ,
5454 } , {
55- required : true , message : 'Path is required!' ,
55+ required : true , message : 'Name is required!' ,
5656 } ] ,
5757 } ) (
5858 < Input />
5959 ) }
6060 </ FormItem >
6161
62+ < FormItem
63+ { ...formItemLayout }
64+ label = "With demo"
65+ >
66+ { this . props . form . getFieldDecorator ( 'withDemo' , {
67+ initialValue : true ,
68+ valuePropName : "checked"
69+ } ) (
70+ < Switch />
71+ ) }
72+ </ FormItem >
73+
6274 < FormItem { ...tailFormItemLayout } >
6375 < Button
6476 type = "primary"
@@ -72,7 +84,7 @@ class FormComponent extends PureComponent<Props, State> {
7284
7385 private handleSubmit = async ( e : any ) => {
7486 e . preventDefault ( ) ;
75- await this . props . ApplicationAction . addPage ( this . props . form . getFieldsValue ( ) )
87+ await this . props . ApplicationAction . addStore ( this . props . form . getFieldsValue ( ) )
7688 this . props . onSuccess ( )
7789 }
7890}
0 commit comments