feat(sidebar): implement sidebar visibility toggling

This commit is contained in:
2026-07-31 20:59:19 +02:00
committed by Gitea
parent 5b1f2b57a7
commit e43784bff0
2 changed files with 47 additions and 5 deletions
+15 -2
View File
@@ -16,14 +16,27 @@ limitations under the License.
<script setup>
import SidebarExpandButton from './SidebarExpandButton.vue';
const props = defineProps({
'expanded': {
default: false,
required: false,
type: Boolean
}
});
const emit = defineEmits(['toggleExpanded']);
const toggleSidebar = function toggleSidebar () {
emit('toggleExpanded');
};
</script>
<template>
<nav class="sidebar">
<div class="sidebar-controls">
<SidebarExpandButton />
<SidebarExpandButton @click="toggleSidebar" />
</div>
<div class="sidebar-content">
<div class="sidebar-content" v-if="props.expanded">
<slot />
</div>
</nav>