Skip to content

Commit 20318db

Browse files
authored
Merge pull request #9 from deanfchung/master
child multiselect, dropdown element list, dashboard, active component, right click
2 parents 089b7cc + f913177 commit 20318db

File tree

4 files changed

+112
-17
lines changed

4 files changed

+112
-17
lines changed

package-lock.json

Lines changed: 68 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
"electron-devtools-installer": "^2.2.4",
3535
"eslint": "^5.10.0",
3636
"eslint-loader": "^2.1.1",
37-
"eslint-plugin-vue": "^5.0.0"
37+
"eslint-plugin-vue": "^5.0.0",
38+
"strip-ansi": "^3.0.1"
3839
},
3940
"engines": {
4041
"node": ">= 8.9.0",

src/components/ComponentDisplay.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ export default {
4848
...mapState(['routes', 'activeRoute', 'activeComponent', 'componentMap']),
4949
// used in VueDraggableResizeable component
5050
activeRouteArray () {
51+
// console.log('active route array method', this.routes[this.activeRoute])
5152
return this.routes[this.activeRoute]
5253
},
5354
// used to delete components

src/components/HomeSideDropDown.vue

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<q-card>
66
<q-card-section>
77
<div class="input-container">
8+
<!--
89
<q-input
910
standout="bg-teal text-white"
1011
bottom-slots
@@ -13,11 +14,24 @@
1314
:dense="dense"
1415
class="input-add"
1516
>
17+
1618
<template v-slot:append>
1719
<q-btn round dense flat icon="add" />
1820
</template>
1921
</q-input>
20-
<ComponentList />
22+
-->
23+
<a v-for="componentData in activeRouteDisplay"
24+
:key="componentData.componentName"
25+
v-on:click="onActivated(componentData)"
26+
>
27+
<q-list bordered separator>
28+
<q-item clickable v-ripple>
29+
<q-item-section>{{componentData.componentName}}</q-item-section>
30+
31+
</q-item>
32+
33+
</q-list>
34+
</a>
2135
</div>
2236
</q-card-section>
2337
</q-card>
@@ -83,12 +97,35 @@
8397
</template>
8498
<script>
8599
import RouteDisplay from '../components/RouteDisplay'
86-
import ComponentList from './HomeSideDropDownItems/ComponentList'
100+
import { mapState, mapActions } from 'vuex'
87101
88102
export default {
89103
components: {
90-
RouteDisplay,
91-
ComponentList
104+
RouteDisplay
105+
},
106+
computed: {
107+
...mapState(['routes', 'activeRoute', 'activeComponent', 'componentMap']),
108+
// used in VueDraggableResizeable component
109+
activeRouteDisplay () {
110+
// console.log('active route array method', this.routes[this.activeRoute])
111+
let component = this.routes[this.activeRoute]
112+
// console.log('component:', component)
113+
return component
114+
},
115+
activeComponentData () {
116+
// find out what this does
117+
return this.activeRouteDisplay.filter(componentData => {
118+
return componentData.componentName === this.activeComponent
119+
})[0]
120+
}
121+
},
122+
methods: {
123+
...mapActions(['setActiveComponent']),
124+
onActivated (componentData) {
125+
this.setActiveComponent(componentData.componentName)
126+
this.activeComponentData.isActive = true
127+
console.log('this.activeComponent', this.activeComponent)
128+
}
92129
}
93130
}
94131
</script>

0 commit comments

Comments
 (0)