ant-design-vue/components/tabs/demo/nest.md

70 lines
1.8 KiB
Markdown
Raw Normal View History

2019-01-07 12:51:57 +00:00
### for debug
2019-09-28 12:45:07 +00:00
2019-01-07 12:51:57 +00:00
<cn>
#### 基本
默认选中第一项。
</cn>
<us>
#### Nest
Default activate first tab.
</us>
2019-10-09 10:32:23 +00:00
```tpl
2019-01-07 12:51:57 +00:00
<template>
2019-09-28 12:45:07 +00:00
<div>
<a-select style="width: 200px" v-model="parentPos">
<a-select-option v-for="pos in positionList" :key="pos" :value="pos"
>Parent - {{pos}}</a-select-option
>
</a-select>
2019-01-07 12:51:57 +00:00
2019-09-28 12:45:07 +00:00
<a-select style="width: 200px" v-model="childPos">
<a-select-option v-for="pos in positionList" :key="pos" :value="pos"
>Child - {{pos}}</a-select-option
>
</a-select>
2019-01-07 12:51:57 +00:00
2019-09-28 12:45:07 +00:00
<a-select style="width: 200px" v-model="parentType">
<a-select-option value="line">Parent - line</a-select-option>
<a-select-option value="card">Parent - card</a-select-option>
</a-select>
2019-01-07 12:51:57 +00:00
2019-09-28 12:45:07 +00:00
<a-select style="width: 200px" v-model="childType">
<a-select-option value="line">Child - line</a-select-option>
<a-select-option value="card">Child - card</a-select-option>
</a-select>
2019-01-07 12:51:57 +00:00
2019-09-28 12:45:07 +00:00
<a-tabs defaultActiveKey="1" :tabPosition="parentPos" :type="parentType">
<a-tab-pane tab="Tab 1" key="1">
<a-tabs
:defaultActiveKey="1"
:tabPosition="childPos"
:type="childType"
style="height: 300px"
>
<a-tab-pane v-for="key in list" :tab="`Tab ${key}`" :key="key">TTTT {{key}}</a-tab-pane>
</a-tabs>
</a-tab-pane>
<a-tab-pane tab="Tab 2" key="2">Content of Tab Pane 2</a-tab-pane>
</a-tabs>
</div>
2019-01-07 12:51:57 +00:00
</template>
<script>
2019-09-28 12:45:07 +00:00
const positionList = ['left', 'right', 'top', 'bottom'];
const list = new Array(20).fill().map((_, index) => index);
export default {
data() {
return {
positionList,
list,
parentPos: undefined,
childPos: undefined,
parentType: undefined,
childType: undefined,
};
},
};
2019-01-07 12:51:57 +00:00
</script>
```