Menu.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <template>
  2. <v-navigation-drawer
  3. :mini-variant.sync="miniVariant"
  4. clipped
  5. class="ot_dark_grey ot_menu_color--text"
  6. fixed
  7. app
  8. >
  9. <v-list>
  10. <div v-for="(item, i) in menu" :key="i">
  11. <v-list-item
  12. v-if="!item.children"
  13. :href="item.isExternalLink ? item.to : undefined"
  14. :to="!item.isExternalLink ? item.to : undefined"
  15. router
  16. exact
  17. >
  18. <v-list-item-action>
  19. <v-icon class="ot_menu_color--text" small>
  20. {{ item.icon }}
  21. </v-icon>
  22. </v-list-item-action>
  23. <v-list-item-content>
  24. <v-list-item-title class="ot_menu_color--text" v-text="$t(item.title)" />
  25. </v-list-item-content>
  26. </v-list-item>
  27. <v-list-group
  28. v-else
  29. v-model="item.active"
  30. no-action
  31. >
  32. <template v-slot:activator>
  33. <v-list-item-action>
  34. <v-icon class="ot_menu_color--text" small>
  35. {{ item.icon }}
  36. </v-icon>
  37. </v-list-item-action>
  38. <v-list-item-content>
  39. <v-list-item-title class="ot_menu_color--text" v-text="$t(item.title)" />
  40. </v-list-item-content>
  41. </template>
  42. <v-list-item
  43. v-for="child in item.children"
  44. :key="child.title"
  45. :href="child.isExternalLink ? child.to : undefined"
  46. :to="!child.isExternalLink ? child.to : undefined"
  47. router
  48. exact
  49. >
  50. <v-list-item-action>
  51. <v-icon class="ot_menu_color--text" small>
  52. {{ child.icon }}
  53. </v-icon>
  54. </v-list-item-action>
  55. <v-list-item-content>
  56. <v-list-item-title class="ot_menu_color--text" v-text="$t(child.title)" />
  57. </v-list-item-content>
  58. </v-list-item>
  59. </v-list-group>
  60. </div>
  61. </v-list>
  62. </v-navigation-drawer>
  63. </template>
  64. <script lang="ts">
  65. import { defineComponent } from '@nuxtjs/composition-api'
  66. import { ItemsMenu } from '~/types/interfaces'
  67. export default defineComponent({
  68. props: {
  69. menu: {
  70. type: Array as () => ItemsMenu,
  71. required: true
  72. },
  73. miniVariant: {
  74. type: Boolean,
  75. required: true
  76. }
  77. }
  78. })
  79. </script>
  80. <style scoped>
  81. .v-list-item__action, .v-list-group__header__prepend-icon {
  82. margin-right: 10px !important;
  83. }
  84. .v-application--is-ltr .v-list-group--no-action > .v-list-group__items > .v-list-item {
  85. padding-left: 30px;
  86. }
  87. .v-list-item__title {
  88. font-size: 14px;
  89. }
  90. .v-list-item {
  91. min-height: 10px !important;
  92. }
  93. .v-list-item__action {
  94. margin: 10px 0;
  95. }
  96. .v-list-item__content {
  97. padding: 8px 0;
  98. }
  99. .home_menu {
  100. font-size: 23px;
  101. }
  102. </style>