fix(admin): 折叠菜单内逐级选页并记住桌面偏好
This commit is contained in:
+5
-15
@@ -32,23 +32,13 @@ const elConfig = {
|
||||
}
|
||||
const { width } = useWindowSize()
|
||||
watch(
|
||||
width,
|
||||
(value, previous) => {
|
||||
// Resizing within one desktop breakpoint must not reopen the fixed
|
||||
// navigation pane after the user explicitly closed it.
|
||||
if (settings.adminUi === 'v2' && previous !== undefined &&
|
||||
[width, () => settings.adminUi],
|
||||
([value, ui], [previous, previousUi]) => {
|
||||
// Don't reset transient v2 navigation within the same desktop breakpoint.
|
||||
if (ui === 'v2' && ui === previousUi && previous !== undefined &&
|
||||
value > ScreenEnum.SM && previous > ScreenEnum.SM &&
|
||||
(value < ScreenEnum.MD) === (previous < ScreenEnum.MD)) return
|
||||
if (value > ScreenEnum.SM) {
|
||||
appStore.setMobile(false)
|
||||
appStore.toggleCollapsed(false)
|
||||
} else {
|
||||
appStore.setMobile(true)
|
||||
appStore.toggleCollapsed(true)
|
||||
}
|
||||
if (value < ScreenEnum.MD) {
|
||||
appStore.toggleCollapsed(true)
|
||||
}
|
||||
appStore.syncSidebarViewport(value, ui)
|
||||
},
|
||||
{
|
||||
immediate: true
|
||||
|
||||
Reference in New Issue
Block a user