Skip to content

Commit 4bfb58e

Browse files
committed
merge conflicts, merged with Johnny
2 parents 93b2827 + aa41e0b commit 4bfb58e

File tree

3 files changed

+52
-40
lines changed

3 files changed

+52
-40
lines changed

src/components/right-sidebar/CodeSnippet.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export default {
124124
} else {
125125
nestedString += htmlElementMap[child.text][0];
126126
if (child.class !== "") {
127-
nestedString += " " + "class = " + `"${el.class}"`;
127+
nestedString += " " + "class = " + `"${child.class}"`;
128128
}
129129
if (child.text === "img" || child.text === "input" || child.text === "link") {
130130
nestedString += "/>";

src/components/right-sidebar/HTMLQueue.vue

Lines changed: 48 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -31,45 +31,54 @@ Description:
3131
<i class="fas fa fa-trash fa-md" @click.self="deleteElement([element[1], element[2]])"></i>
3232
</div>
3333
</div>
34-
</div>
35-
36-
<!-- attribute pop-up -->
37-
<q-dialog v-model="attributeModal">
38-
<!-- @update:model-value="setActiveElement" -->
39-
<div class="AttributeBox">
40-
<p class="title">Add attributes to: {{ this.activeComponent }}</p>
41-
<!--attribute child-->
42-
<div class="AttributeContainer" v-for="element in this.componentMap[this.activeComponent].htmlList"
43-
:key="element.id + Date.now()">
44-
<p v-if="element.id === this.activeHTML">Your class is - {{ element.class }}</p>
45-
<p v-if="element.id === this.activeHTML"> You've binded to - {{ element.binding }}</p>
46-
</div>
47-
<!-- <div class="AttributeContainer" v-for="element in this.componentMap[this.activeComponent].htmlList"
48-
:key="element.id + Date.now()">
49-
50-
</div> -->
51-
52-
<div class="formBox">
53-
<q-form autofocus v-on:submit.prevent="submitClass">
54-
<p class="title">Add Class Name:</p>
55-
<q-input label="Add your class here" filled dark autofocus true hide-bottom-space v-model="classText"
56-
@keyup.enter="submitClass"></q-input>
57-
<q-btn id="comp-btn" class="sidebar-btn" color="secondary" label="Submit Attribute"
58-
:disable="classText.length > 0 ? false : true" @click="submitClass(classText, this.activeHTML)" />
59-
</q-form>
60-
<q-form autofocus v-on:submit.prevent="addBinding">
61-
<p class="title">Add Binding:</p>
62-
63-
<q-input label="Add two way binding here" filled dark autofocus true hide-bottom-space v-model="bindingText"
64-
@keyup.enter="addBinding"></q-input>
65-
<q-btn id="comp-btn" class="sidebar-btn" color="secondary" label="Add Binding"
66-
:disable="bindingText.length > 0 ? false : true" @click="addBinding(bindingText, this.activeHTML)">
67-
</q-btn>
68-
</q-form>
69-
<q-btn label="Close" @click="this.openAttributeModal" />
34+
35+
<!-- attribute pop-up -->
36+
<q-dialog v-model="attributeModal">
37+
<!-- @update:model-value="setActiveElement" -->
38+
<div class="AttributeBox">
39+
<p class="title">Add attributes to: {{ this.activeComponent }}</p>
40+
<!--attribute child-->
41+
<div class="AttributeContainer" v-for="element in this.componentMap[this.activeComponent].htmlList"
42+
:key="element.id + Date.now()">
43+
<p v-if="element.id === this.activeHTML">Your class is - {{ element.class }}</p>
44+
<p v-if="element.id === this.activeHTML"> You've binded to - {{ element.binding }}</p>
45+
</div>
46+
<!--attribute child's child-->
47+
<div class="AttributeContainer" v-for="element in this.componentMap[this.activeComponent].htmlList"
48+
:key="element.id + Date.now()">
49+
<ul v-for="element1 in element.children" :key="element1.id + Date.now()">
50+
<li v-if="element1.id === this.activeHTML">Your class is - {{ element1.class }}</li>
51+
</ul>
52+
</div>
53+
54+
<div class="AttributeContainer" v-for="element in this.componentMap[this.activeComponent].htmlList"
55+
:key="element.id + Date.now()">
56+
<ul v-for="element1 in element.children" :key="element1.id + Date.now()">
57+
<li v-if="element1.id === this.activeHTML">You've binded to - {{ element1.binding }}</li>
58+
</ul>
59+
</div>
60+
61+
<div class="formBox">
62+
<q-form autofocus v-on:submit.prevent="submitClass">
63+
<p class="title">Add Class Name:</p>
64+
<q-input label="Add your class here" filled dark autofocus true hide-bottom-space v-model="classText"
65+
@keyup.enter="submitClass"></q-input>
66+
<q-btn id="comp-btn" class="sidebar-btn" color="secondary" label="Submit Attribute"
67+
:disable="classText.length > 0 ? false : true" @click="submitClass(classText, this.activeHTML)" />
68+
</q-form>
69+
<q-form autofocus v-on:submit.prevent="addBinding">
70+
<p class="title">Add Binding:</p>
71+
72+
<q-input label="Add two way binding here" filled dark autofocus true hide-bottom-space
73+
v-model="bindingText" @keyup.enter="addBinding"></q-input>
74+
<q-btn id="comp-btn" class="sidebar-btn" color="secondary" label="Add Binding"
75+
:disable="bindingText.length > 0 ? false : true" @click="addBinding(bindingText, this.activeHTML)">
76+
</q-btn>
77+
</q-form>
78+
<q-btn label="Close" @click="this.openAttributeModal" />
79+
</div>
7080
</div>
71-
</div>
72-
</q-dialog>
81+
</q-dialog>
7382
</section>
7483
</template>
7584

@@ -99,7 +108,7 @@ export default {
99108
}
100109
},
101110
computed: {
102-
...mapState(['selectedElementList', 'componentMap', 'activeComponent', 'activeHTML', 'activeLayer', 'attributeModalOpen']),
111+
...mapState(['activeComponentObj', 'selectedElementList', 'componentMap', 'activeComponent', 'activeHTML', 'activeLayer', 'attributeModalOpen']),
103112
renderList: {
104113
get() {
105114
if (this.activeComponent === '') return this.selectedElementList.map((el, index) => [el.text, index, el.id])

src/store/mutations.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,7 @@ const mutations = {
431431

432432
[types.SET_ACTIVE_LAYER]: (state, payload) => {
433433
const newLayer = cloneDeep(state.activeLayer);
434+
434435
newLayer.lineage.push(payload.text);
435436
newLayer.id = payload.id;
436437
state.activeLayer = newLayer;
@@ -803,6 +804,7 @@ const mutations = {
803804

804805
[types.ADD_ACTIVE_COMPONENT_CLASS]: (state, payload) => {
805806
if (state.activeComponentObj.htmlList)
807+
806808
state.componentMap[state.activeComponent].htmlList.forEach((el) => {
807809
//adding class into it's child 1st layer
808810
if (el.children.length !== 0) {
@@ -816,6 +818,7 @@ const mutations = {
816818
el.class = payload.class
817819
}
818820
})
821+
819822
},
820823

821824
// //add binding

0 commit comments

Comments
 (0)