feature: 简易版菜单宽度拖拽功能

This commit is contained in:
zouawen
2026-02-25 17:50:19 +08:00
parent 03ebbea46a
commit 57cf6cbc9e
3 changed files with 53 additions and 3 deletions

View File

@@ -211,6 +211,14 @@ 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>
@@ -267,6 +275,7 @@ const headerSlots = computed(() => {
(value: boolean) =>
updatePreferences({ sidebar: { extraCollapse: value } })
"
@update:sidebar-width="handleUpdateSidebarWidth"
>
<!-- logo -->
<template #logo>