File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
src/vfjs-global-mixin/methods/vfjs-model Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change 11import { cloneDeep , isEqual } from 'lodash' ;
2- import { VFJS_EVENT_FIELD_MODEL_UPDATE , VFJS_EVENT_MODEL_UPDATED } from '../../../constants' ;
2+ import {
3+ VFJS_EVENT_FIELD_MODEL_UPDATE ,
4+ VFJS_EVENT_MODEL_VALIDATE ,
5+ VFJS_EVENT_STATE_UPDATE ,
6+ VFJS_EVENT_MODEL_UPDATED ,
7+ } from '../../../constants' ;
38
49const vfjsModelSetters = {
510 setVfjsFieldModel ( value , key ) {
@@ -13,7 +18,17 @@ const vfjsModelSetters = {
1318 this . vfjsModel = cloneDeep ( model ) ;
1419
1520 if ( ! silent ) {
16- this . vfjsBus . $emit ( VFJS_EVENT_MODEL_UPDATED , this . getVfjsModel ( ) ) ;
21+ this . vfjsBus . $emit ( VFJS_EVENT_MODEL_VALIDATE , {
22+ vfjsModel : this . vfjsModel ,
23+ cb : ( newVfjsState ) => {
24+ this . vfjsBus . $emit ( VFJS_EVENT_STATE_UPDATE , {
25+ value : newVfjsState ,
26+ cb : ( ) => {
27+ this . vfjsBus . $emit ( VFJS_EVENT_MODEL_UPDATED ) ;
28+ } ,
29+ } ) ;
30+ } ,
31+ } ) ;
1732 }
1833 }
1934 } ,
You can’t perform that action at this time.
0 commit comments