ant-design-vue/components/collapse/demo/accordion.vue

47 lines
1009 B
Vue
Raw Normal View History

2021-09-01 07:04:46 +00:00
<docs>
---
order: 1
title:
zh-CN: 手风琴
en-US: Accordion
---
## zh-CN
手风琴每次只打开一个 tab
## en-US
In accordion mode, only one panel can be expanded at a time.
</docs>
<template>
<a-collapse v-model:activeKey="activeKey" accordion>
<a-collapse-panel key="1" header="This is panel header 1">
<p>{{ text }}</p>
</a-collapse-panel>
<a-collapse-panel key="2" header="This is panel header 2">
<p>{{ text }}</p>
</a-collapse-panel>
<a-collapse-panel key="3" header="This is panel header 3">
<p>{{ text }}</p>
</a-collapse-panel>
</a-collapse>
</template>
<script lang="ts">
import { defineComponent, ref } from 'vue';
export default defineComponent({
setup() {
const activeKey = ref([]);
const text = `A dog is a type of domesticated animal.Known for its loyalty and faithfulness,it can be found as a welcome guest in many households across the world.`;
return {
activeKey,
text,
};
},
});
</script>