App.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <template>
  2. <div id="app">
  3. <header>
  4. <b-navbar>
  5. <b-dropdown variant="link" no-caret>
  6. <template #button-content>
  7. <span class="navbar-toggler-icon" />
  8. <span class="sr-only">Menu</span>
  9. </template>
  10. <b-dropdown-item v-for="name in subRoutes" :key="name" :to="{ name }">
  11. {{ $t('sections.' + name) }}
  12. </b-dropdown-item>
  13. </b-dropdown>
  14. <b-navbar-brand :to="{ name: 'home' }">
  15. {{ $t('title') }}
  16. </b-navbar-brand>
  17. <b-nav class="ml-auto" pills>
  18. <b-nav-item
  19. v-for="name in mainRoutes" :key="name"
  20. :to="{ name }" :active="$route.name === name"
  21. >
  22. {{ $t('sections.' + name) }}
  23. </b-nav-item>
  24. </b-nav>
  25. </b-navbar>
  26. <router-view name="options" />
  27. </header>
  28. <main id="main">
  29. <router-view />
  30. </main>
  31. </div>
  32. </template>
  33. <script>
  34. export default {
  35. name: 'App',
  36. metaInfo () {
  37. return {
  38. // if no subcomponents specify a metaInfo.title, try to get one from the route name.
  39. title: this.$t('sections.' + this.$route.name, ''),
  40. // all titles will be injected into this template
  41. titleTemplate: '%s | ' + this.$t('title')
  42. }
  43. },
  44. data () {
  45. return {
  46. mainRoutes: ['library', 'kit', 'gallery'],
  47. subRoutes: ['home', 'introduction', 'blog', 'contact']
  48. }
  49. }
  50. }
  51. </script>
  52. <style lang="scss">
  53. @import '@/assets/scss/main.scss';
  54. </style>