From 90147493fb9a14b8cbbef41dab92e77d8748f3e6 Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Tue, 8 Mar 2022 17:02:03 +0800 Subject: [PATCH] doc: tabs add destroyInactiveTabPane --- components/tabs/demo/custom-add-trigger.vue | 10 ++++++---- components/tabs/index.en-US.md | 1 + components/tabs/index.zh-CN.md | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/components/tabs/demo/custom-add-trigger.vue b/components/tabs/demo/custom-add-trigger.vue index de131cbf9..73537c52a 100644 --- a/components/tabs/demo/custom-add-trigger.vue +++ b/components/tabs/demo/custom-add-trigger.vue @@ -33,10 +33,12 @@ import { defineComponent, ref } from 'vue'; export default defineComponent({ setup() { - const panes = ref<{ title: string; content: string; key: string; closable?: boolean }[]>([ - { title: 'Tab 1', content: 'Content of Tab 1', key: '1' }, - { title: 'Tab 2', content: 'Content of Tab 2', key: '2' }, - ]); + const panes = ref<{ title: string; content: string; key: string; closable?: boolean }[]>( + new Array(2).fill(null).map((_, index) => { + const id = String(index + 1); + return { title: `Tab ${id}`, content: `Content of Tab Pane ${id}`, key: id }; + }), + ); const activeKey = ref(panes.value[0].key); const newTabIndex = ref(0); diff --git a/components/tabs/index.en-US.md b/components/tabs/index.en-US.md index b1ea9faf9..828d819a0 100644 --- a/components/tabs/index.en-US.md +++ b/components/tabs/index.en-US.md @@ -27,6 +27,7 @@ Ant Design has 3 types of Tabs for different situations. | size | preset tab bar size | `large` \| `default` \| `small` | `default` | | | tabBarStyle | Tab bar style object | object | - | | | tabPosition | Position of tabs | `top` \| `right` \| `bottom` \| `left` | `top` | | +| destroyInactiveTabPane | Whether destroy inactive TabPane when change tab | boolean | false | | | type | Basic style of tabs | `line` \| `card` \| `editable-card` | `line` | | | tabBarGutter | The gap between tabs | number | - | | diff --git a/components/tabs/index.zh-CN.md b/components/tabs/index.zh-CN.md index 373d03bd4..74e81ef59 100644 --- a/components/tabs/index.zh-CN.md +++ b/components/tabs/index.zh-CN.md @@ -31,6 +31,7 @@ Ant Design 依次提供了三级选项卡,分别用于不同的场景。 | size | 大小,提供 `large` `default` 和 `small` 三种大小 | string | `default` | | | tabBarStyle | tab bar 的样式对象 | object | - | | | tabPosition | 页签位置,可选值有 `top` `right` `bottom` `left` | string | `top` | | +| destroyInactiveTabPane | 被隐藏时是否销毁 DOM 结构 | boolean | false | | | type | 页签的基本样式,可选 `line`、`card` `editable-card` 类型 | string | `line` | | | tabBarGutter | tabs 之间的间隙 | number | 无 | |