Are you an LLM? You can read better optimized documentation at /30.生态/03.公共组件/TransitionCollapse 折叠动画.md for this page in Markdown format
TransitionCollapse 折叠动画
使用 TransitionCollapse
组件的动画效果控制内容的展示与隐藏。
基础用法
使用折叠动画组件
vue
<script setup lang="ts">
import { TkTransitionCollapse } from "vitepress-theme-teek";
import { ref } from "vue";
const visible = ref(false);
</script>
<template>
<button @click="visible = !visible" style="margin-bottom: 10px">点击我切换</button>
<TkTransitionCollapse>
<div v-show="visible">使用折叠动画组件</div>
</TkTransitionCollapse>
</template>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
隐藏源代码