Skip to content

Commit 6e8af14

Browse files
committed
updated inputHTMLMenu
1 parent 78fc341 commit 6e8af14

File tree

1 file changed

+29
-24
lines changed

1 file changed

+29
-24
lines changed

src/components/left-sidebar/ComponentTab/InputHTMLMenu.vue

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,33 @@
22

33
<template >
44
<div class="AttributeBox">
5-
<div class="AttributeContainer" v-for="element in componentMap.value[activeComponent.value].htmlList"
5+
<div class="AttributeContainer" v-for="element in componentMap[activeComponent].htmlList"
66
:key="element.id + Date.now()">
7-
<p v-if="element.id === activeHTML.value" class="title">Your class {{ element.class.length !== 0 ? 'is ' + element.class : 'has not been stated yet' }}</p>
7+
<p v-if="element.id === activeHTML" class="title">Your class {{ element.class.length !== 0 ? 'is ' + element.class : 'has not been stated yet' }}</p>
88
</div>
99
<q-form autofocus v-on:submit.prevent="submitClass">
1010
<q-input label="Add/Change your class name" filled dark autofocus true hide-bottom-space v-model="classText"
1111
@keydown.enter="submitClass">
1212
<i id="comp-btn" class="fa-solid fa-right-to-bracket"
13-
:disable="classText.length > 0 ? false : true" @click.self="submitClass(classText, activeHTML.value)">
13+
:disable="classText.length > 0 ? false : true" @click.self="submitClass(classText, activeHTML)">
1414
</i>
1515
</q-input>
1616
</q-form>
1717
<q-form autofocus v-on:submit.prevent="addBinding">
1818
<q-input label="Add/Change two-way binding" filled dark autofocus true hide-bottom-space v-model="bindingText"
19-
@keydown.enter="addBinding(bindingText, activeHTML.value)">
19+
@keydown.enter="addBinding(bindingText, activeHTML)">
2020
<i id="compt-btn" class="fa-solid fa-right-to-bracket" label="Add Binding"
21-
:disable="bindingText.length > 0 ? false : true" @click.self="addBinding(bindingText, activeHTML.value)">
21+
:disable="bindingText.length > 0 ? false : true" @click.self="addBinding(bindingText, activeHTML)">
2222
</i>
2323
</q-input>
2424
</q-form>
25-
<div class="AttributeContainer" v-for="element in componentMap.value[activeComponent.value].htmlList"
25+
<div class="AttributeContainer" v-for="element in componentMap[activeComponent].htmlList"
2626
:key="element.id + Date.now()">
27-
<div v-if="exceptions.includes(element.text) && element.id === activeHTML.value">
27+
<div v-if="exceptions.includes(element.text) && element.id === activeHTML">
2828
<q-form autofocus v-on:submit.prevent="submitNote">
2929
<q-input label="Add Inner Text" filled dark autofocus true hide-bottom-space v-model="noteText" @keydown.enter="submitNote">
3030
<i class="fa-solid fa-right-to-bracket" color="secondary" label="Submit Note"
31-
:disable="noteText.length > 0 ? false : true" @click.self="submitNote(noteText, activeHTML.value)">
31+
:disable="noteText.length > 0 ? false : true" @click.self="submitNote(noteText, activeHTML)">
3232
</i>
3333
</q-input>
3434
</q-form>
@@ -44,8 +44,8 @@
4444
:label-value="'Height:' + heightText"
4545
inner-track-color="primary"
4646
color="secondary"
47-
@change="submitHeight(heightText, activeHTML.value)"
48-
@update:model-value="submitHeight(heightText, activeHTML.value)"
47+
@change="submitHeight(heightText, activeHTML)"
48+
@update:model-value="submitHeight(heightText, activeHTML)"
4949
style="float: left; margin-left: 5% "
5050
/>
5151
</q-form>
@@ -60,8 +60,8 @@
6060
:label-value="'Elevation:' + topText"
6161
inner-track-color="primary"
6262
color="secondary"
63-
@change="submitTop(topText, activeHTML.value)"
64-
@update:model-value="submitTop(topText, activeHTML.value)"
63+
@change="submitTop(topText, activeHTML)"
64+
@update:model-value="submitTop(topText, activeHTML)"
6565
style="float: left; margin-left: 35%"
6666
/>
6767
</q-form>
@@ -75,8 +75,8 @@
7575
:label-value="'Width:' + widthText"
7676
inner-track-color="primary"
7777
color="secondary"
78-
@change="submitWidth(widthText, activeHTML.value)"
79-
@update:model-value="submitWidth(widthText, activeHTML.value)"
78+
@change="submitWidth(widthText, activeHTML)"
79+
@update:model-value="submitWidth(widthText, activeHTML)"
8080
style="margin-top: 20%"
8181
/>
8282
</q-form>
@@ -90,36 +90,36 @@
9090
:label-value="'Position:' + leftText"
9191
inner-track-color="primary"
9292
color="secondary"
93-
@change="submitLeft(leftText, activeHTML.value)"
94-
@update:model-value="submitLeft(leftText, activeHTML.value)"
93+
@change="submitLeft(leftText, activeHTML)"
94+
@update:model-value="submitLeft(leftText, activeHTML)"
9595
style="margin-top: 20%"
9696
/>
9797
</q-form>
9898
<q-form autofocus v-on:submit.prevent="submitHeight">
9999
<q-input label="Adjust height (0-100)" filled dark autofocus true hide-bottom-space v-model="heightText" @keydown="submitHeight">
100100
<i class="fa-solid fa-right-to-bracket" color="secondary" label="Submit Height"
101-
@click.self="submitHeight(heightText, activeHTML.value)">
101+
@click.self="submitHeight(heightText, activeHTML)">
102102
</i>
103103
</q-input>
104104
</q-form>
105105
<q-form autofocus v-on:submit.prevent="submitWidth">
106106
<q-input label="Adjust width (0-100)" filled dark autofocus true hide-bottom-space v-model="widthText" @keydown.enter="submitWidth">
107107
<i class="fa-solid fa-right-to-bracket" color="secondary" label="Submit Width"
108-
@click.self="submitWidth(widthText, activeHTML.value)">
108+
@click.self="submitWidth(widthText, activeHTML)">
109109
</i>
110110
</q-input>
111111
</q-form>
112112
<q-form autofocus v-on:submit.prevent="submitTop">
113113
<q-input label="Adjust Elevation (0-100)" filled dark autofocus true hide-bottom-space v-model="topText" @keydown.enter="submitTop">
114114
<i class="fa-solid fa-right-to-bracket" color="secondary" label="Submit Height"
115-
@click.self="submitTop(topText, activeHTML.value)">
115+
@click.self="submitTop(topText, activeHTML)">
116116
</i>
117117
</q-input>
118118
</q-form>
119119
<q-form autofocus v-on:submit.prevent="submitLeft">
120120
<q-input label="Adjust Distance (0-100)" filled dark autofocus true hide-bottom-space v-model="leftText" @keydown.enter="submitLeft">
121121
<i class="fa-solid fa-right-to-bracket" color="secondary" label="Submit Position"
122-
@click="submitLeft(leftText, activeHTML.value)">
122+
@click="submitLeft(leftText, activeHTML)">
123123
</i>
124124
</q-input>
125125
</q-form>
@@ -133,9 +133,9 @@
133133
@click="(e) => handleLayer(e)"
134134
/>
135135
<!-- nested for loop to iterate to display current z-index for selected htmlElement -->
136-
<template v-for="element in routes.value[activeRoute.value]">
136+
<template v-for="element in routes[activeRoute]">
137137
<template v-for="element1 in element.htmlList">
138-
<p v-if="element1.id === activeHTML.value" id="counter" :key="element1.id">{{ element1.z }} </p>
138+
<p v-if="element1.id === activeHTML" id="counter" :key="element1.id">{{ element1.z }} </p>
139139
</template>
140140
</template>
141141
<q-btn
@@ -169,8 +169,10 @@ const leftText = ref('');
169169
const z = ref('0');
170170
const noteText = ref('');
171171
const bindingText = ref('');
172+
const note = ref('');
172173
173174
onMounted(() => {
175+
console.log("onMounted test", widthText.value);
174176
//for loop to access nested HTML elements of components - sets height/width/top/left sliders to current value of selected HTML element
175177
for (let i = 0; i <routes.value[activeRoute.value].length; i++) {
176178
for (let j = 0; j < routes.value[activeRoute.value][i].htmlList.length; j++) {
@@ -184,6 +186,8 @@ for (let i = 0; i <routes.value[activeRoute.value].length; i++) {
184186
}
185187
});
186188
189+
//computed
190+
187191
const selectedElementList = computed(() => store.state.selectedElementList);
188192
const componentMap = computed(() => store.state.componentMap);
189193
const activeComponent = computed(() => store.state.activeComponent);
@@ -234,7 +238,8 @@ const submitNote = (element, idNum) => {
234238
id: idNum
235239
}
236240
addActiveComponentElementNote(payload);
237-
note.value = '';
241+
console.log("Ins")
242+
text.value = '';
238243
};
239244
240245
const submitHeight = (element, idNum) => {
@@ -327,7 +332,7 @@ const addBinding = (input, idNum) => {
327332
id: idNum
328333
}
329334
addBindingText(payload);
330-
bindingText = '';
335+
bindingText.value = '';
331336
};
332337
333338

0 commit comments

Comments
 (0)