File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change 22
22
-->
23
23
<a v-for =" componentData in activeRouteDisplay"
24
24
:key =" componentData.componentName"
25
+ v-on:click =" onActivated(componentData)"
25
26
>
26
27
<q-list bordered separator >
27
28
<q-item clickable v-ripple >
96
97
</template >
97
98
<script >
98
99
import RouteDisplay from ' ../components/RouteDisplay'
99
- import { mapState } from ' vuex'
100
+ import { mapState , mapActions } from ' vuex'
100
101
101
102
export default {
102
103
components: {
@@ -108,8 +109,22 @@ export default {
108
109
activeRouteDisplay () {
109
110
// console.log('active route array method', this.routes[this.activeRoute])
110
111
let component = this .routes [this .activeRoute ]
111
- console .log (' component:' , component)
112
+ // console.log('component:', component)
112
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 )
113
128
}
114
129
}
115
130
}
You can’t perform that action at this time.
0 commit comments