doc: tabs add destroyInactiveTabPane

feat-css-var
tangjinzhou 2022-03-08 17:02:03 +08:00
parent a635000a14
commit 90147493fb
3 changed files with 8 additions and 4 deletions

View File

@ -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);

View File

@ -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 | - | |

View File

@ -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 | 无 | |