@@ -206,31 +206,7 @@ const mutations = {
206
206
[ state . activeComponent ] : state . activeComponentObj ,
207
207
} ;
208
208
} ,
209
- // //add binding
210
- [ types . addBindingText ] : ( state , payload ) => {
211
- //access the htmlList, add payload to the empty bind obj
212
- //const active = state.componentMap[state.activeComponent].htmlList;
213
- if ( payload === "" ) {
214
- state . componentMap = {
215
- ...state . componentMap
216
- }
217
- } else {
218
- const id = payload . id
219
- state . componentMap [ state . activeComponentObj ] . htmlList . forEach ( ( el ) => {
220
209
221
- if ( el . children . length !== 0 ) {
222
- el . children . forEach ( ( element ) => {
223
- if ( payload . id === element . id ) {
224
- element . binding = payload . binding
225
- }
226
- } )
227
- }
228
- if ( payload . id === el . id ) {
229
- el . binding = payload . binding
230
- }
231
- } )
232
- }
233
- } ,
234
210
[ types . DELETE_ACTION_FROM_COMPONENT ] : ( state , payload ) => {
235
211
state . componentMap [ state . activeComponent ] . actions = state . componentMap [ state . activeComponent ] . actions . filter (
236
212
( action ) => action !== payload ) ;
@@ -842,6 +818,33 @@ const mutations = {
842
818
} )
843
819
} ,
844
820
821
+ // //add binding
822
+ [ types . addBindingText ] : ( state , payload ) => {
823
+ //access the htmlList, add payload to the empty bind obj
824
+ //const active = state.componentMap[state.activeComponent].htmlList;
825
+ if ( payload . binding === "" ) {
826
+ state . componentMap = {
827
+ ...state . componentMap
828
+ }
829
+ } else {
830
+ const id = payload . id
831
+
832
+ if ( state . activeComponentObj . htmlList )
833
+ state . componentMap [ state . activeComponent ] . htmlList . forEach ( ( el ) => {
834
+
835
+ if ( el . children . length !== 0 ) {
836
+ el . children . forEach ( ( element ) => {
837
+ if ( payload . id === element . id ) {
838
+ element . binding = payload . binding
839
+ }
840
+ } )
841
+ }
842
+ if ( payload . id === el . id ) {
843
+ el . binding = payload . binding
844
+ }
845
+ } )
846
+ }
847
+ } ,
845
848
846
849
[ types . DELETE_ACTIVE_COMPONENT_CLASS ] : ( state , payload ) => {
847
850
state . componentMap [ state . activeComponent ] . classList . forEach ( ( el , ind ) => {
0 commit comments