|
5 | 5 | <q-card> |
6 | 6 | <q-card-section> |
7 | 7 | <div class="input-container"> |
| 8 | + <!-- |
8 | 9 | <q-input |
9 | 10 | standout="bg-teal text-white" |
10 | 11 | bottom-slots |
|
13 | 14 | :dense="dense" |
14 | 15 | class="input-add" |
15 | 16 | > |
| 17 | +
|
16 | 18 | <template v-slot:append> |
17 | 19 | <q-btn round dense flat icon="add" /> |
18 | 20 | </template> |
19 | 21 | </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> |
21 | 35 | </div> |
22 | 36 | </q-card-section> |
23 | 37 | </q-card> |
|
83 | 97 | </template> |
84 | 98 | <script> |
85 | 99 | import RouteDisplay from '../components/RouteDisplay' |
86 | | -import ComponentList from './HomeSideDropDownItems/ComponentList' |
| 100 | +import { mapState, mapActions } from 'vuex' |
87 | 101 |
|
88 | 102 | export default { |
89 | 103 | 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 | + } |
92 | 129 | } |
93 | 130 | } |
94 | 131 | </script> |
|
0 commit comments