File tree Expand file tree Collapse file tree
src/views/feature_example Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<route lang="yaml">
22meta :
33 enabled : false
4- </route >
4+ </route >
55
66<script setup lang="ts">
77const settingsStore = useSettingsStore ()
88const menuStore = useMenuStore ()
99
1010const menu = useMenu ()
1111
12- function switchTo() {
12+ function switchToPrev() {
13+ menu .switchTo (menuStore .actived - 1 >= 0 ? menuStore .actived - 1 : menuStore .allMenus .length - 1 )
14+ }
15+
16+ function switchToNext() {
1317 menu .switchTo (menuStore .actived + 1 < menuStore .allMenus .length ? menuStore .actived + 1 : 0 )
1418}
1519 </script >
@@ -19,7 +23,10 @@ function switchTo() {
1923 <FaPageHeader title="主导航切换" description="可切换并激活指定的主导航" />
2024 <FaPageMain >
2125 <p >该特性只有在导航模式为 side 和 head 时生效。</p >
22- <ElButton :disabled =" ! [' side' , ' head' ].includes (settingsStore .settings .menu .mode )" @click =" switchTo " >
26+ <ElButton :disabled =" ! [' side' , ' head' ].includes (settingsStore .settings .menu .mode )" @click =" switchToPrev " >
27+ 切换上一个
28+ </ElButton >
29+ <ElButton :disabled =" ! [' side' , ' head' ].includes (settingsStore .settings .menu .mode )" @click =" switchToNext " >
2330 切换下一个
2431 </ElButton >
2532 </FaPageMain >
You can’t perform that action at this time.
0 commit comments