Skip to content

Commit 21b58d5

Browse files
committed
components dropdown displays component name on active route
1 parent 1fdf979 commit 21b58d5

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/components/ComponentDisplay.vue

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

src/components/HomeSideDropDown.vue

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,17 @@
2020
</template>
2121
</q-input>
2222
-->
23+
<a v-for="componentData in activeRouteDisplay"
24+
:key="componentData.componentName"
25+
>
2326
<q-list bordered separator>
2427
<q-item clickable v-ripple>
25-
<q-item-section>Component Name</q-item-section>
28+
<q-item-section>{{componentData.componentName}}</q-item-section>
2629

2730
</q-item>
2831

2932
</q-list>
33+
</a>
3034
</div>
3135
</q-card-section>
3236
</q-card>
@@ -92,10 +96,21 @@
9296
</template>
9397
<script>
9498
import RouteDisplay from '../components/RouteDisplay'
99+
import { mapState } from 'vuex'
95100
96101
export default {
97102
components: {
98103
RouteDisplay
104+
},
105+
computed: {
106+
...mapState(['routes', 'activeRoute', 'activeComponent', 'componentMap']),
107+
// used in VueDraggableResizeable component
108+
activeRouteDisplay () {
109+
// console.log('active route array method', this.routes[this.activeRoute])
110+
let component = this.routes[this.activeRoute]
111+
console.log('component:', component)
112+
return component
113+
}
99114
}
100115
}
101116
</script>

0 commit comments

Comments
 (0)