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 2222 -->
2323 <a v-for =" componentData in activeRouteDisplay"
2424 :key =" componentData.componentName"
25+ v-on:click =" onActivated(componentData)"
2526 >
2627 <q-list bordered separator >
2728 <q-item clickable v-ripple >
9697</template >
9798<script >
9899import RouteDisplay from ' ../components/RouteDisplay'
99- import { mapState } from ' vuex'
100+ import { mapState , mapActions } from ' vuex'
100101
101102export default {
102103 components: {
@@ -108,8 +109,22 @@ export default {
108109 activeRouteDisplay () {
109110 // console.log('active route array method', this.routes[this.activeRoute])
110111 let component = this .routes [this .activeRoute ]
111- console .log (' component:' , component)
112+ // console.log('component:', component)
112113 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 )
113128 }
114129 }
115130}
You can’t perform that action at this time.
0 commit comments