|
1 | 1 | <script setup> |
2 | | -import { ref, computed, onMounted, onUnmounted, nextTick } from 'vue' |
| 2 | +import { ref, computed, onMounted, onUnmounted } from 'vue' |
3 | 3 | import { useRoute, useRouter, useData, withBase } from 'vitepress' |
4 | 4 | import { getVersionNavItems, getVersionByPath, getVersionLabel, isLocaleSupported } from '../../cake.js' |
5 | 5 |
|
@@ -37,7 +37,7 @@ const closeDropdown = () => { |
37 | 37 | isOpen.value = false |
38 | 38 | } |
39 | 39 |
|
40 | | -const handleVersionClick = (version, event) => { |
| 40 | +const handleVersionClick = (version, _event) => { |
41 | 41 | closeDropdown() |
42 | 42 |
|
43 | 43 | pendingVersionNavigation.value = { |
@@ -97,22 +97,35 @@ onUnmounted(() => { |
97 | 97 |
|
98 | 98 | <template> |
99 | 99 | <div class="version-dropdown"> |
100 | | - <button class="nav-dropdown-link" @click="toggleDropdown" :aria-expanded="isOpen"> |
| 100 | + <button |
| 101 | + class="nav-dropdown-link" |
| 102 | + :aria-expanded="isOpen" |
| 103 | + @click="toggleDropdown" |
| 104 | + > |
101 | 105 | {{ currentVersionText }} |
102 | | - <span class="dropdown-arrow" :class="{ open: isOpen }">▼</span> |
| 106 | + <span |
| 107 | + class="dropdown-arrow" |
| 108 | + :class="{ open: isOpen }" |
| 109 | + >▼</span> |
103 | 110 | </button> |
104 | | - <ul v-show="isOpen" class="nav-dropdown-links"> |
105 | | - <li v-for="version in versionNavItems" :key="version.path"> |
| 111 | + <ul |
| 112 | + v-show="isOpen" |
| 113 | + class="nav-dropdown-links" |
| 114 | + > |
| 115 | + <li |
| 116 | + v-for="version in versionNavItems" |
| 117 | + :key="version.path" |
| 118 | + > |
106 | 119 | <a |
107 | | - :href="withBase(version.link)" |
108 | | - :class="{ active: withBase(version.path) === currentPath }" |
109 | | - @click="handleVersionClick(version, $event)" |
| 120 | + :href="withBase(version.link)" |
| 121 | + :class="{ active: withBase(version.path) === currentPath }" |
| 122 | + @click="handleVersionClick(version, $event)" |
110 | 123 | > |
111 | | - {{ version.text }} |
112 | | - </a> |
113 | | - </li> |
114 | | - </ul> |
115 | | -</div> |
| 124 | + {{ version.text }} |
| 125 | + </a> |
| 126 | + </li> |
| 127 | + </ul> |
| 128 | + </div> |
116 | 129 | </template> |
117 | 130 |
|
118 | 131 | <style scoped> |
|
0 commit comments