App.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. <nav class="nav-list ml-auto">
  18. <ul>
  19. <li v-for="link in mainRoutes" :key="link.to">
  20. <b-button :to="link.to" :active="$route.name === link.to" :variant="link.variant">
  21. {{ $t('sections.' + link.to) }}
  22. </b-button>
  23. </li>
  24. </ul>
  25. </nav>
  26. </b-navbar>
  27. <router-view name="options" />
  28. </header>
  29. <main id="main">
  30. <router-view />
  31. </main>
  32. </div>
  33. </template>
  34. <script>
  35. export default {
  36. name: 'App',
  37. metaInfo () {
  38. return {
  39. // if no subcomponents specify a metaInfo.title, try to get one from the route name.
  40. title: this.$t('sections.' + this.$route.name, ''),
  41. // all titles will be injected into this template
  42. titleTemplate: '%s | ' + this.$t('title')
  43. }
  44. },
  45. data () {
  46. return {
  47. mainRoutes: [
  48. { to: 'library', variant: 'dark' },
  49. { to: 'kit', variant: 'kit' },
  50. { to: 'gallery', variant: 'creation' }
  51. ],
  52. subRoutes: ['home', 'introduction', 'blog', 'contact']
  53. }
  54. }
  55. }
  56. </script>
  57. <style lang="scss">
  58. @import '@/assets/scss/app.scss';
  59. </style>
  60. <style lang="scss" scoped>
  61. .navbar-brand {
  62. font-size: 1.3125rem;
  63. font-weight: $font-weight-bold;
  64. text-decoration: none;
  65. }
  66. .nav-list {
  67. a:not(.active) {
  68. opacity: .25;
  69. }
  70. }
  71. </style>