diff options
author | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2019-12-03 12:41:39 +0100 |
---|---|---|
committer | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2019-12-03 12:41:39 +0100 |
commit | 65ff7d9f2daa59e44f0cdb1aae8d7cbcd9d4603f (patch) | |
tree | eb29c520c6aef433edeeaf14c8eba2a536d62770 /components/TheHeader.vue | |
parent | 64b16669dcab8c0c29c377d12ff6b996b5caa0d3 (diff) | |
download | puszcza-65ff7d9f2daa59e44f0cdb1aae8d7cbcd9d4603f.tar.gz puszcza-65ff7d9f2daa59e44f0cdb1aae8d7cbcd9d4603f.zip |
Fix menu open
Diffstat (limited to 'components/TheHeader.vue')
-rw-r--r-- | components/TheHeader.vue | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/components/TheHeader.vue b/components/TheHeader.vue index 431b945..4d17616 100644 --- a/components/TheHeader.vue +++ b/components/TheHeader.vue @@ -1,14 +1,21 @@ <template> - <nav class="navbar" :class="{'menu-open': isMenuCollapsed}"> + <nav class="navbar" :class="{ 'menu-open': showMenu }"> <div class="title"> <img v-if="logo" class="logo" :src="logo" alt="ZHR" /> - <nuxt-link class="title-name" :class="{margin: logo}" to="/">{{ title }}</nuxt-link> + <nuxt-link class="title-name" :class="{ margin: logo }" to="/">{{ + title + }}</nuxt-link> </div> <div class="space"></div> <button @click="toggleMenu" class="menu-toggler">Menu</button> - <ul class="links" :class="{show: this.isMenuCollapsed}" @click="toggleMenu"> + <ul class="links" :class="{ show: this.showMenu }" @click="toggleMenu"> <!-- Loop for generating links --> - <nav-link v-for="route in routes" :key="route.path" :link="route.path" :name="route.name" /> + <nav-link + v-for="route in routes" + :key="route.path" + :link="route.path" + :name="route.name" + /> </ul> </nav> </template> @@ -38,12 +45,12 @@ export default { }, data: function() { return { - isMenuCollapsed: true + showMenu: false } }, methods: { toggleMenu() { - this.isMenuCollapsed = !this.isMenuCollapsed + this.showMenu = !this.showMenu } } } @@ -180,4 +187,4 @@ export default { height: calc(100% - 80px); } } -</style> \ No newline at end of file +</style> |