<template>
<TiButton @click="handle('fade')">fade</TiButton>
<TiButton @click="handle('fade-down')">fade down</TiButton>
<TiButton @click="handle('fade-left')">fade left</TiButton>
<TiButton @click="handle('slide-down')">slide down</TiButton>
<TiButton @click="handle('slide-up')">slide up</TiButton>
<TiButton @click="handle('slide-left')">slide left</TiButton>
<TiButton @click="handle('slide-right')">slide right</TiButton>
<TiButton @click="handle('zoom')">zoom</TiButton>
<TiTransition :show="show" :name="name" @entered="close()">
<div class="transition-card" />
</TiTransition>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
import { TiTransition, TiButton, TransitionName } from 'titian-h5-vue';
const show = ref(false);
const name = ref<TransitionName>('fade');
const close = () => {
show.value = false;
};
const handle = (type: TransitionName) => {
if (!show.value) {
show.value = true;
name.value = type;
}
};
</script>
<style>
.transition-card {
width: 40px;
height: 40px;
background-color: #fa2c19;
}
</style>