Navbar.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <header>
  3. <router-link to="/" v-slot="{ href, navigate, isExactActive }">
  4. <a :class="{ 'active': isExactActive }" :href="href" @click="navigate">
  5. Homepage
  6. </a>
  7. </router-link>
  8. <router-link to="/accounts" v-slot="{ href, navigate, isExactActive }">
  9. <a :class="{ 'active': isExactActive }" :href="href" @click="navigate">
  10. Accounts
  11. </a>
  12. </router-link>
  13. <router-link to="/schemas" v-slot="{ href, navigate, isExactActive }">
  14. <a :class="{ 'active': isExactActive }" :href="href" @click="navigate">
  15. Schemas
  16. </a>
  17. </router-link>
  18. <router-link to="/options" v-slot="{ href, navigate, isExactActive }">
  19. <a :class="{ 'active': isExactActive }" :href="href" @click="navigate">
  20. Options
  21. </a>
  22. </router-link>
  23. </header>
  24. </template>
  25. <script>
  26. export default {
  27. components: {},
  28. data: () => {
  29. return {
  30. }
  31. },
  32. methods: {
  33. },
  34. mounted() {
  35. }
  36. };
  37. </script>
  38. <style lang="scss" scoped>
  39. header {
  40. display: flex;
  41. width: 100%;
  42. height: 60px;
  43. background-color: green;
  44. flex-direction: row;
  45. a {
  46. text-align: center;
  47. padding: 10px;
  48. vertical-align: middle;
  49. line-height: 40px;
  50. text-decoration: none;
  51. color: white;
  52. font-size: 20px;
  53. &.active {
  54. background-color: darkgreen;
  55. }
  56. }
  57. }
  58. </style>