当用户创建只有一个面板的TabPage且标签位置在顶部时,Panel标题栏会正确显示

This commit is contained in:
zqm
2026-01-16 16:04:58 +08:00
parent dd421b5d1e
commit e060f9272a
3 changed files with 12 additions and 4 deletions

View File

@@ -39,8 +39,8 @@
</div>
<div class="flex flex-col h-full">
<!-- 标题栏 - 当tabPosition为top时不显示 -->
<div v-if="props._tabPosition !== 'top'" class="title-bar h-6 bg-[#435d9c] text-white px-2 flex items-center justify-between select-none cursor-move"
<!-- 标题栏 - 当tabPosition为top且标签栏显示时不显示否则显示 -->
<div v-if="props._tabPosition !== 'top' || !props._showTabs" class="title-bar h-6 bg-[#435d9c] text-white px-2 flex items-center justify-between select-none cursor-move"
:style="{ cursor: isSinglePanel && isMaximized ? 'default' : 'move' }"
@mousedown="onDragStart">
<div class="flex items-center">
@@ -209,6 +209,11 @@ const props = defineProps({
type: String,
default: 'top'
},
// 父级TabPage是否显示标签栏
_showTabs: {
type: Boolean,
default: true
},
// 移除areaId属性因为面板会被拖拽到不同区域
// 改为通过DOM动态获取当前所在区域
});

View File

@@ -94,7 +94,8 @@ const componentProps = computed(() => {
toolbarExpanded: config.toolbarExpanded || false,
maximized: config.maximized || false,
content: config.content,
_tabPosition: config._tabPosition
_tabPosition: config._tabPosition,
_showTabs: config._showTabs // 添加_showTabs属性传递
}
default:

View File

@@ -94,7 +94,9 @@
:config="{
...activeChild,
// 传递tabPosition信息给子组件
_tabPosition: adjustedTabPosition
_tabPosition: adjustedTabPosition,
// 传递标签栏显示状态给子组件
_showTabs: shouldShowTabs
}"
style="width: 100%; height: 100%;"
/>