Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | <template> <div class="dropdown-container"> <div class="d-flex justify-content-between align-items-center cursor-pointer" @click="toggleDropdown"> <div v-if="dropdownSpecs['subTitles']" class="d-flex justify-content-start align-items-center"> <img :src="dropdownSpecs['titleIcon']" :alt="`${dropdownSpecs['title']} icon`"> <p class="d-flex justify-content-between mb-0 ms-2">{{ dropdownSpecs['title'] }}</p> </div> <nuxt-link v-else to="#" class="d-flex justify-content-start align-items-center text-decoration-none"> <img :src="dropdownSpecs['titleIcon']" :alt="`${dropdownSpecs['title']} icon`"> <p class="d-flex justify-content-between mb-0 ms-2">{{ dropdownSpecs['title'] }}</p> </nuxt-link> <svg v-if="dropdownSpecs['subTitles']" xmlns='http://www.w3.org/2000/svg' stroke="white" stroke-width="1" viewBox='0 0 16 16' fill="white"> <path d='M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z'/> </svg> </div> <ul v-if="dropdownSpecs['subTitles']" :class="{'open': dropdownSpecs['isActive']}" class="mt-3"> <li v-for="(subtitle, index) in dropdownSpecs['subTitles']" :key="index"> <nuxt-link :to="`/admin/dashboard/${subtitle.toLowerCase().split(' ').join('-')}`" class="text-decoration-none link">{{ subtitle }}</nuxt-link> </li> </ul> </div> </template> <script> export default { props: ['dropdownSpecs'], emits: ['toggleDropdown'], data() { return { isDropdownActive: false } }, methods: { /** * Toggles the dropdown * @see toggleDropdown * @returns void */ toggleDropdown() { this.isDropdownActive = !this.isDropdownActive; let activeTab = (this.dropdownSpecs['title'] !== this.dropdownSpecs['activeTab'] && this.dropdownSpecs['activeTab'] !== 'none') || this.dropdownSpecs['activeTab'] == 'none'? this.dropdownSpecs['title'] : 'none'; this.$emit('toggleDropdown', activeTab); } } } </script> <style lang="scss" scoped> p { color: white; font-size: 1.2rem; } img { width: 20px; height: 20px; } svg { width: 20px; height: 20px; } .cursor-pointer { cursor: pointer; } ul { //transform: scaleY(0); //height: 0; //transition: transform .3s ease-in-out; //transform-origin: center top; display: none; list-style-type: none; } ul.open { //height: auto; //transform: scaleY(1); display: block; } .link { color: white; font-size: 1rem; } @include media-breakpoint-down(lg) { img { width: 15px; height: 15px; } svg { width: 15px; height: 15px; } p { font-size: 1rem; } .link { font-size: .9rem; } } @include media-breakpoint-down(md) { img { width: 12px; height: 12px; } svg { width: 12px; height: 12px; } p { font-size: .8rem; } .link { font-size: .7rem; } } </style> |