Skip to content

Commit

Permalink
show/hide the children on click of a router
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardW committed Jan 12, 2020
1 parent d440040 commit bacf6b4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/route.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
>{{ route.name }}</text>
<route
v-for="(child, index) in route.children"
v-show="showChildren"
:key="child.path"
:route="child"
:start-radius="outerRadius + config.constants.spaceBetweenParentChild"
Expand Down Expand Up @@ -93,7 +94,8 @@ export default {
},
data() {
return {
arcGenerator: arc()
arcGenerator: arc(),
showChildren: false
};
},
computed: {
Expand Down Expand Up @@ -129,6 +131,10 @@ export default {
methods: {
routeClicked(path) {
this.$router.push({ path });
},
selectRoute($event) {
this.showChildren = !this.showChildren;
this.$emit("clicked", $event);
}
}
};
Expand Down

0 comments on commit bacf6b4

Please sign in to comment.