Untitled

mail@pastecode.io avatar
unknown
plain_text
3 years ago
923 B
49
Indexable
Never
<template>
<header>
 <Burger />
  <Sidebar>
    <ul>
      <li>
        <nuxt-link to="/" title="Home page" @click.prevent="closeSidebar">Home</nuxt-link>
      </li>
      <li v-for="menuLink in $store.state.menu.menu_links" :key="menuLink.id">
        <prismic-link :field="menuLink.link" :title="$prismic.asText(menuLink.label)" @click.prevent="closeSidebar">{{ $prismic.asText(menuLink.label) }}</prismic-link>
      </li>
    </ul>
  </Sidebar>
</header>
</template>

<script>
import Burger from '~/components/Burger.vue';
import Sidebar from '~/components/Sidebar.vue';
import { mutations } from '~/store'

export default {
  name: "HeaderInner",
  components: {
    Burger,
    Sidebar
  },
  data() {
    return {
      global: null
    };
  },
  methods: {
    closeSidebar() {
      mutations.toggleNav();
    }
  },
  async fetch() {
    this.global = await this.$prismic.api.getSingle("global");
  }
}
</script>