@@ -48,8 +48,11 @@ export default {
48
48
cache : false ,
49
49
get ( ) {
50
50
let val ;
51
- if ( isFunction ( this . schema . get ) ) val = this . schema . get ( this . model ) ;
52
- else if ( this . model && this . schema . model ) val = objGet ( this . model , this . schema . model ) ;
51
+ if ( isFunction ( objGet ( this . schema , 'get' ) ) ) {
52
+ val = this . schema . get ( this . model ) ;
53
+ } else {
54
+ val = objGet ( this . model , this . schema . model ) ;
55
+ }
53
56
54
57
return this . formatValueToField ( val ) ;
55
58
} ,
@@ -156,7 +159,7 @@ export default {
156
159
this . schema . onChanged . call ( this , this . model , newValue , oldValue , this . schema ) ;
157
160
}
158
161
159
- if ( objGet ( this . $parent , "options" ) && objGet ( this . $parent , "options .validateAfterChanged", false ) === true ) {
162
+ if ( objGet ( this . $parent , "options.validateAfterChanged" , false ) === true ) {
160
163
if ( objGet ( this . $parent , "options.validateDebounceTime" , 0 ) > 0 ) {
161
164
this . debouncedValidate ( ) ;
162
165
} else {
@@ -203,12 +206,12 @@ export default {
203
206
} ,
204
207
205
208
getFieldID ( schema ) {
206
- const idPrefix = this . formOptions && objGet ( this . formOptions , "fieldIdPrefix" ) ? objGet ( this . formOptions , "fieldIdPrefix" ) : "" ;
209
+ const idPrefix = objGet ( this . formOptions , "fieldIdPrefix" , "" ) ;
207
210
return slugifyFormID ( schema , idPrefix ) ;
208
211
} ,
209
212
210
213
getFieldClasses ( ) {
211
- return objGet ( this . schema , "fieldClasses" ) || [ ] ;
214
+ return objGet ( this . schema , "fieldClasses" , [ ] ) ;
212
215
} ,
213
216
214
217
formatValueToField ( value ) {
0 commit comments