Skip to content

Commit 93b2827

Browse files
committed
moving branches
1 parent ef77ed7 commit 93b2827

File tree

1 file changed

+27
-24
lines changed

1 file changed

+27
-24
lines changed

src/store/mutations.js

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -206,31 +206,7 @@ const mutations = {
206206
[state.activeComponent]: state.activeComponentObj,
207207
};
208208
},
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) => {
220209

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-
},
234210
[types.DELETE_ACTION_FROM_COMPONENT]: (state, payload) => {
235211
state.componentMap[state.activeComponent].actions = state.componentMap[state.activeComponent].actions.filter(
236212
(action) => action !== payload);
@@ -842,6 +818,33 @@ const mutations = {
842818
})
843819
},
844820

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+
},
845848

846849
[types.DELETE_ACTIVE_COMPONENT_CLASS]: (state, payload) => {
847850
state.componentMap[state.activeComponent].classList.forEach((el, ind) => {

0 commit comments

Comments
 (0)