feat: 优化侧边栏拖拽逻辑

This commit is contained in:
zouawen
2026-02-26 18:11:30 +08:00
parent 3d4ae04d9b
commit 99710ef9dc
3 changed files with 72 additions and 41 deletions

View File

@@ -211,14 +211,6 @@ const slots: SetupContext['slots'] = useSlots();
const headerSlots = computed(() => {
return Object.keys(slots).filter((key) => key.startsWith('header-'));
});
function handleUpdateSidebarWidth(newWidth: number) {
updatePreferences({
sidebar: {
width: newWidth,
},
});
}
</script>
<template>
@@ -275,7 +267,9 @@ function handleUpdateSidebarWidth(newWidth: number) {
(value: boolean) =>
updatePreferences({ sidebar: { extraCollapse: value } })
"
@update:sidebar-width="handleUpdateSidebarWidth"
@update:sidebar-width="
(value: number) => updatePreferences({ sidebar: { width: value } })
"
>
<!-- logo -->
<template #logo>