File tree Expand file tree Collapse file tree 3 files changed +8
-7
lines changed Expand file tree Collapse file tree 3 files changed +8
-7
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " element-react" ,
3- "version" : " 1.1.7 " ,
3+ "version" : " 1.1.8 " ,
44 "description" : " Element UI for React" ,
55 "private" : false ,
66 "main" : " dist/npm/es5/index.js" ,
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ export default class Form extends Component {
7373 return (
7474 < form style = { this . style ( ) } className = { this . className ( 'el-form' , this . props . labelPosition && `el-form--label-${ this . props . labelPosition } ` , {
7575 'el-form--inline' : this . props . inline
76- } ) } > { this . props . children } </ form >
76+ } ) } onSubmit = { this . props . onSubmit } > { this . props . children } </ form >
7777 )
7878 }
7979}
@@ -88,7 +88,8 @@ Form.propTypes = {
8888 labelPosition : PropTypes . oneOf ( [ 'right' , 'left' , 'top' ] ) ,
8989 labelWidth : PropTypes . oneOfType ( [ PropTypes . string , PropTypes . number ] ) ,
9090 labelSuffix : PropTypes . string ,
91- inline : PropTypes . bool
91+ inline : PropTypes . bool ,
92+ onSubmit : PropTypes . func
9293}
9394
9495Form . defaultProps = {
Original file line number Diff line number Diff line change @@ -156,29 +156,29 @@ export default class FormItem extends Component {
156156 } ) ;
157157 }
158158
159- labelStyle ( ) : { width ?: number } {
159+ labelStyle ( ) : { width ?: number | string } {
160160 const ret = { } ;
161161
162162 if ( this . parent ( ) . props . labelPosition === 'top' ) return ret ;
163163
164164 const labelWidth = this . props . labelWidth || this . parent ( ) . props . labelWidth ;
165165
166166 if ( labelWidth ) {
167- ret . width = Number ( labelWidth ) ;
167+ ret . width = parseInt ( labelWidth ) ;
168168 }
169169
170170 return ret ;
171171 }
172172
173- contentStyle ( ) : { marginLeft ?: number } {
173+ contentStyle ( ) : { marginLeft ?: number | string } {
174174 const ret = { } ;
175175
176176 if ( this . parent ( ) . props . labelPosition === 'top' || this . parent ( ) . props . inline ) return ret ;
177177
178178 const labelWidth = this . props . labelWidth || this . parent ( ) . props . labelWidth ;
179179
180180 if ( labelWidth ) {
181- ret . marginLeft = Number ( labelWidth ) ;
181+ ret . marginLeft = parseInt ( labelWidth ) ;
182182 }
183183
184184 return ret ;
You can’t perform that action at this time.
0 commit comments