File tree 1 file changed +4
-8
lines changed
package/components/SchemaComponents
1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -253,16 +253,13 @@ class SchemaNumber extends PureComponent {
253
253
254
254
changeEnumOtherValue = ( value , data ) => {
255
255
this . setState ( { enum : value } ) ;
256
- let arr = value . split ( '\n' ) ;
257
- const enumLen = this . state . enum . split ( '\n' ) . length ;
258
- // 判断是否是删除操作
259
- if ( enumLen > arr . length ) {
260
- data . enum = arr . map ( item => + item ) ;
261
- this . context . changeCustomValue ( data ) ;
262
- }
256
+ var arr = value . split ( '\n' ) ;
263
257
if ( arr . length === 0 || ( arr . length == 1 && ! arr [ 0 ] ) ) {
264
258
delete data . enum ;
265
259
this . context . changeCustomValue ( data ) ;
260
+ } else {
261
+ data . enum = arr . map ( item => + item ) ;
262
+ this . context . changeCustomValue ( data ) ;
266
263
}
267
264
} ;
268
265
@@ -397,7 +394,6 @@ class SchemaNumber extends PureComponent {
397
394
onChange = { e => {
398
395
this . changeEnumOtherValue ( e . target . value , data ) ;
399
396
} }
400
- onPressEnter = { e => this . onEnterEnumOtherValue ( e . target . value , data ) }
401
397
/>
402
398
</ Col >
403
399
</ Row >
You can’t perform that action at this time.
0 commit comments