修复浮动面板中TabPage内Panel未显示问题:1. 修改TabPage支持slot渲染;2. 修复DockLayout中showTitleBar属性设置
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
:id="area.id"
|
:id="area.id"
|
||||||
:title="area.title"
|
:title="area.title"
|
||||||
v-model:WindowState="area.WindowState"
|
v-model:WindowState="area.WindowState"
|
||||||
:showTitleBar="area.panels && area.panels.length === 1"
|
:showTitleBar="true"
|
||||||
:width="area.width"
|
:width="area.width"
|
||||||
:height="area.height"
|
:height="area.height"
|
||||||
:left="area.WindowState !== '最大化' ? area.x : undefined"
|
:left="area.WindowState !== '最大化' ? area.x : undefined"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="tab-page">
|
<div class="tab-page">
|
||||||
<!-- Tab标签栏 -->
|
<!-- 当tabs为空时,不显示标签栏,直接渲染slot内容 -->
|
||||||
<div class="tab-header">
|
<div v-if="tabs.length > 0" class="tab-header">
|
||||||
<div
|
<div
|
||||||
v-for="(tab, index) in tabs"
|
v-for="(tab, index) in tabs"
|
||||||
:key="tab.id"
|
:key="tab.id"
|
||||||
@@ -19,12 +19,16 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- Tab页内容区域 -->
|
<!-- Tab页内容区域 -->
|
||||||
<div class="tab-content">
|
<div class="tab-content">
|
||||||
<div v-for="(tab, index) in tabs" :key="tab.id" :class="['tab-panel', { 'active': activeTabIndex === index }]">
|
<!-- 当有tabs时,渲染tabs内容 -->
|
||||||
<component :is="tab.component" v-bind="tab.props"></component>
|
<template v-if="tabs.length > 0">
|
||||||
</div>
|
<div v-for="(tab, index) in tabs" :key="tab.id" :class="['tab-panel', { 'active': activeTabIndex === index }]">
|
||||||
<div v-if="tabs.length === 0" class="tab-empty">
|
<component :is="tab.component" v-bind="tab.props"></component>
|
||||||
<slot name="empty">无标签页</slot>
|
</div>
|
||||||
</div>
|
</template>
|
||||||
|
<!-- 当没有tabs或tabs为空时,渲染slot内容 -->
|
||||||
|
<template v-else>
|
||||||
|
<slot></slot>
|
||||||
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user