当用户创建只有一个面板的TabPage且标签位置在顶部时,Panel标题栏会正确显示
This commit is contained in:
@@ -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动态获取当前所在区域
|
||||
});
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -94,7 +94,9 @@
|
||||
:config="{
|
||||
...activeChild,
|
||||
// 传递tabPosition信息给子组件
|
||||
_tabPosition: adjustedTabPosition
|
||||
_tabPosition: adjustedTabPosition,
|
||||
// 传递标签栏显示状态给子组件
|
||||
_showTabs: shouldShowTabs
|
||||
}"
|
||||
style="width: 100%; height: 100%;"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user