Navbar.vue 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <template>
  2. <navbar>
  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. </navbar>
  19. </template>
  20. <script>
  21. export default {
  22. components: {},
  23. data: () => {
  24. return {
  25. }
  26. },
  27. methods: {
  28. },
  29. mounted() {
  30. }
  31. };
  32. </script>
  33. <style lang="scss" scoped>
  34. navbar {
  35. display: flex;
  36. width: 100%;
  37. height: 60px;
  38. background-color: green;
  39. flex-direction: row;
  40. a {
  41. text-align: center;
  42. padding: 10px;
  43. vertical-align: middle;
  44. line-height: 40px;
  45. text-decoration: none;
  46. color: white;
  47. font-size: 20px;
  48. &.active {
  49. background-color: darkgreen;
  50. }
  51. }
  52. }
  53. </style>