fix(resource-pannel): 调整资源面板的展开触发方式为点击标签页

移除顶部资源标题的点击展开事件,为各标签页添加点击触发展开的事件并优化模板条件顺序,提升用户体验
This commit is contained in:
yangsy
2026-05-28 16:24:55 +08:00
parent d5b380e1e3
commit 2f38e97481
@@ -41,7 +41,7 @@ const expandResourcePanel = () => {
<template>
<NFlex vertical :size="0" style="width: 480px; height: 100%; overflow: hidden">
<NFlex style="width: 100%; min-height: 38px; padding: 8px 16px" :align="'center'">
<div @click="expandResourcePanel">资源</div>
<div>资源</div>
<template v-if="!collapsed">
<NInput clearable :size="'tiny'" :placeholder="'搜索'" style="width: 360px; margin-left: auto" />
<NButton text @click="collapseResourcePanel">
@@ -50,8 +50,14 @@ const expandResourcePanel = () => {
</template>
</NFlex>
<NTabs :type="'line'" :placement="'left'" style="height: 100%; flex: 1" v-model:value="activeTabName">
<NTabPane v-for="{ name: resourceName, tab: resourceTab, component } in resourceTabPanes" :key="resourceName" :tab="resourceTab" :name="resourceName">
<template v-if="!!component && !collapsed">
<NTabPane
v-for="{ name: resourceName, tab: resourceTab, component } in resourceTabPanes"
:key="resourceName"
:tab="resourceTab"
:name="resourceName"
:tab-props="{ onClick: () => expandResourcePanel() }"
>
<template v-if="!collapsed && !!component">
<component :is="component" />
</template>
</NTabPane>