@@ -348,31 +348,11 @@ export class Field<
348
348
}
349
349
350
350
set value ( value : ValueType ) {
351
- if ( this . destroyed ) return
352
- if ( ! this . initialized ) {
353
- if ( this . display === 'none' ) {
354
- this . caches . value = value
355
- return
356
- }
357
- value = getValidFieldDefaultValue ( value , this . initialValue )
358
- if ( ! allowAssignDefaultValue ( this . value , value ) && ! this . designable ) {
359
- return
360
- }
361
- }
362
- this . form . setValuesIn ( this . path , value )
351
+ this . setValue ( value )
363
352
}
364
353
365
354
set initialValue ( initialValue : ValueType ) {
366
- if ( this . destroyed ) return
367
- if ( ! this . initialized ) {
368
- if (
369
- ! allowAssignDefaultValue ( this . initialValue , initialValue ) &&
370
- ! this . designable
371
- ) {
372
- return
373
- }
374
- }
375
- this . form . setInitialValuesIn ( this . path , initialValue )
355
+ this . setInitialValue ( initialValue )
376
356
}
377
357
378
358
set selfErrors ( messages : FeedbackMessage ) {
@@ -432,11 +412,31 @@ export class Field<
432
412
}
433
413
434
414
setValue = ( value ?: ValueType ) => {
435
- this . value = value
415
+ if ( this . destroyed ) return
416
+ if ( ! this . initialized ) {
417
+ if ( this . display === 'none' ) {
418
+ this . caches . value = value
419
+ return
420
+ }
421
+ value = getValidFieldDefaultValue ( value , this . initialValue )
422
+ if ( ! allowAssignDefaultValue ( this . value , value ) && ! this . designable ) {
423
+ return
424
+ }
425
+ }
426
+ this . form . setValuesIn ( this . path , value )
436
427
}
437
428
438
429
setInitialValue = ( initialValue ?: ValueType ) => {
439
- this . initialValue = initialValue
430
+ if ( this . destroyed ) return
431
+ if ( ! this . initialized ) {
432
+ if (
433
+ ! allowAssignDefaultValue ( this . initialValue , initialValue ) &&
434
+ ! this . designable
435
+ ) {
436
+ return
437
+ }
438
+ }
439
+ this . form . setInitialValuesIn ( this . path , initialValue )
440
440
}
441
441
442
442
setLoading = ( loading ?: boolean ) => {
0 commit comments