Skip to content

Commit 1f0e786

Browse files
committed
final touches, added default values for Vuex
1 parent 077a768 commit 1f0e786

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

src/components/dashboard_items/ComponentDetails.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,23 @@ Description:
3232
<HTMLQueue />
3333
</q-tab-panel>
3434
<q-tab-panel name="state">
35+
<p v-if='!this.activeComponentObj.state.length'>No state in component</p>
3536
<ul id="stateList">
3637
<li v-for="comp in compObj.state" :key="comp">
3738
{{ comp }}
3839
</li>
3940
</ul>
4041
</q-tab-panel>
4142
<q-tab-panel name="actions">
43+
<p v-if='!this.activeComponentObj.actions.length'>No actions in component</p>
4244
<ul id="actionList">
4345
<li v-for="comp in compObj.actions" :key="comp">
4446
{{ comp }}
4547
</li>
4648
</ul>
4749
</q-tab-panel>
4850
<q-tab-panel name="props">
51+
<p v-if='!this.activeComponentObj.props.length'>No props in component</p>
4952
<ul id="propsList">
5053
<li v-for="comp in compObj.props" :key="comp">
5154
{{ comp }}

src/components/dashboard_items/HTMLQueue.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Description:
1414
group="people"
1515
class="list-group"
1616
>
17-
17+
<p v-if='!this.componentMap[this.activeComponent].htmlList.length'>No HTML elements in component</p>
1818
<div
1919
:class="activeHTML === element[2] ? 'list-group-item-selected' : 'list-group-item'"
2020
@dblclick.self="setActiveElement(element)"

src/components/home_sidebar_items/EditDeleteComponents.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ Description:
9595
<toggle-button v-model="showState" class="toggle"/>
9696
</div>
9797
<hr v-if="showState">
98+
<p v-if='showState && !this.activeComponentObj.state.length'>No state in component</p>
9899
<a
99100
v-for="s in this.activeComponentData.state"
100101
:key="s"
@@ -118,6 +119,7 @@ Description:
118119
<toggle-button v-model="showActions" class="toggle"/>
119120
</div>
120121
<hr v-if="showActions">
122+
<p v-if='showActions && !this.activeComponentObj.actions.length'>No actions in component</p>
121123
<a
122124
v-for="action in this.activeComponentData.actions"
123125
:key="action"
@@ -141,6 +143,7 @@ Description:
141143
<toggle-button v-model="showProps" class="toggle" justify='end'/>
142144
</div>
143145
<hr v-if="showProps">
146+
<p v-if='showProps && !this.activeComponentObj.props.length'>No props in component</p>
144147
<a
145148
v-for="prop in this.activeComponentData.props"
146149
:key="prop"

src/store/mutations.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,10 @@ const mutations = {
334334
if (id === state.activeHTML) {
335335
state.activeHTML = ''
336336
}
337-
state.componentMap[componentName].htmlList = htmlList
337+
let newCompMap = state.componentMap
338+
newCompMap[componentName].htmlList = htmlList
339+
state.componentMap = Object.assign({}, newCompMap)
340+
//state.componentMap[componentName].htmlList = htmlList
338341
},
339342

340343
// deletes a element html tag from HTMLQueue

0 commit comments

Comments
 (0)