ant-design-vue/components/tabs/demo/slide.vue
tangjinzhou 75cf264040
refactor: tabs & card (#4732)
* refactor: tabs

* refactor: tabs

* fix: tabs hotreload error

* refactor: rename useRef

* feat: add leftExtra rightExtra

* refactor: tabs

* test: update tabs test

* refactor: card

* doc: update tabs demo

* refactor: add card style

* style: update vue dep
2021-10-07 09:23:36 +08:00

53 lines
1.0 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<docs>
---
order: 3
title:
zh-CN: 滑动
en-US: Slide
---
## zh-CN
可以左右上下滑动容纳更多标签
## en-US
In order to fit in more tabs, they can slide left and right (or up and down).
</docs>
<template>
<div>
<a-radio-group v-model:value="mode" :style="{ marginBottom: '8px' }">
<a-radio-button value="top">Horizontal</a-radio-button>
<a-radio-button value="left">Vertical</a-radio-button>
</a-radio-group>
<a-tabs
v-model:activeKey="activeKey"
:tab-position="mode"
:style="{ height: '200px' }"
@tabScroll="callback"
>
<a-tab-pane v-for="i in 30" :key="i" :tab="`Tab-${i}`">Content of tab {{ i }}</a-tab-pane>
</a-tabs>
</div>
</template>
<script lang="ts">
import { defineComponent, ref } from 'vue';
export default defineComponent({
setup() {
const mode = ref('top');
const activeKey = ref('1');
const callback = (val: string) => {
console.log(val);
};
return {
mode,
callback,
activeKey,
};
},
});
</script>