diff --git a/src/components/NavBar.vue b/src/components/NavBar.vue index ea188ef..98779f1 100644 --- a/src/components/NavBar.vue +++ b/src/components/NavBar.vue @@ -24,7 +24,7 @@ :class="{'is-active': type === activeType}" :key="type" v-for="type in navTypes" - @click="$emit('setType', type)" + @click="setType(type)" >{{capitalizeFirstLetter(type)}} @@ -54,6 +54,10 @@ export default { }, capitalizeFirstLetter(string) { return string.charAt(0).toUpperCase() + string.slice(1) + }, + setType(type) { + this.toggled = false + this.$emit('setType', type) } } }