Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(doc-detail): 新增文档详情页右区折叠按钮 #1092

Merged
merged 1 commit into from
Oct 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 5 additions & 22 deletions src/dashboard-front/src/views/apiDocs/doc-detail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,6 @@
</bk-dropdown>
</aside>
</main>
<!-- 展示右侧网关/组件基础信息的开关 -->
<aside
class="detail-toggle"
:class="{ 'active': isAsideVisible }"
@click="toggleAsideVisible()"
><i class="apigateway-icon icon-ag-document f14"></i>
</aside>
</header>
<!-- 正文 -->
<main class="page-content">
Expand All @@ -54,7 +47,6 @@
:max="480"
:min="293"
style="flex-grow: 1;"
@collapse-change="updateIsRightAsideCollapsed"
>
<template #main>
<bk-resize-layout
Expand Down Expand Up @@ -183,7 +175,6 @@
<script lang="ts" setup>
import {
computed,
nextTick,
onBeforeMount,
provide,
ref,
Expand Down Expand Up @@ -254,8 +245,6 @@ const sdks = ref<IApiGatewaySdkDoc[] & IComponentSdk[]>([]);
const isSdkInstructionSliderShow = ref(false);
const navList = ref<INavItem[]>([]);
const outerResizeLayoutRef = ref<InstanceType<typeof ResizeLayout> | null>(null);
// 记录右栏折叠状态
const isAsideVisible = ref(true);
const isLoading = ref(false);
const keyword = ref(''); // 筛选器输入框的搜索关键字
const activeGroupPanelNames = ref<string[]>([]); // API分类 collapse 展开的 panel
Expand Down Expand Up @@ -499,16 +488,6 @@ const init = async () => {
}
};

const toggleAsideVisible = () => {
nextTick(() => {
outerResizeLayoutRef.value?.setCollapse(isAsideVisible.value);
});
};

const updateIsRightAsideCollapsed = (collapsed: boolean) => {
isAsideVisible.value = !collapsed;
};

const handleGoBack = () => {
router.push({
name: 'apiDocs',
Expand Down Expand Up @@ -823,7 +802,11 @@ onBeforeMount(() => {

// 隐藏的折叠按钮
:deep(.bk-resize-layout > .bk-resize-layout-aside .bk-resize-collapse) {
display: none !important;
// 避免折叠按钮溢出制造横向滚动条
svg {
width: 16px !important;
height: 16px !important;
}
}
}

Expand Down
Loading