ant-design-vue/components/tabs/demo/slide.vue

45 lines
1.4 KiB
Vue
Raw Normal View History

2017-12-01 12:21:43 +08:00
<template>
<div style="width: 500px">
2017-12-01 18:48:16 +08:00
<RadioGroup v-model="mode" :style="{ marginBottom: '8px' }">
2017-12-01 12:21:43 +08:00
<RadioButton value="top">Horizontal</RadioButton>
<RadioButton value="left">Vertical</RadioButton>
</RadioGroup>
2017-12-01 18:48:16 +08:00
<Tabs defaultActiveKey="1" :tabPosition="mode" :style="{ height: '200px'}" @prevClick="callback" @nextClick="callback">
2017-12-08 11:46:53 +08:00
<TabPane tab="Tab 1" key="1">Content of tab 1</TabPane>
<TabPane tab="Tab 2" key="2">Content of tab 2</TabPane>
<TabPane tab="Tab 3" key="3">Content of tab 3</TabPane>
<TabPane tab="Tab 4" key="4">Content of tab 4</TabPane>
<TabPane tab="Tab 5" key="5">Content of tab 5</TabPane>
<TabPane tab="Tab 6" key="6">Content of tab 6</TabPane>
<TabPane tab="Tab 7" key="7">Content of tab 7</TabPane>
<TabPane tab="Tab 8" key="8">Content of tab 8</TabPane>
<TabPane tab="Tab 9" key="9">Content of tab 9</TabPane>
<TabPane tab="Tab 10" key="10">Content of tab 10</TabPane>
<TabPane tab="Tab 11" key="11">Content of tab 11</TabPane>
2017-12-01 12:21:43 +08:00
</Tabs>
</div>
</template>
<script>
import { Tabs, Radio } from 'antd'
export default {
data () {
return {
mode: 'top',
}
},
methods: {
2017-12-01 18:48:16 +08:00
callback (val) {
console.log(val)
},
2017-12-01 12:21:43 +08:00
},
components: {
Tabs,
TabPane: Tabs.TabPane,
Radio,
RadioGroup: Radio.Group,
RadioButton: Radio.Button,
},
}
</script>