docs: [tooltip] improve document content and examples (#19204)

docs: [Tooltip] Improve document content and examples
This commit is contained in:
Jeff 2024-12-10 21:38:35 +08:00 committed by GitHub
parent ae22c959ac
commit d9da5341d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 23 additions and 16 deletions

View File

@ -132,7 +132,13 @@ tooltip/controlled
## Animations
Tooltip can be customized animated, you can set the desired animation function as you desired.
Tooltip can be customized animated, you can set the desired animation use `transition`.
:::tip
Transition Classes, more information can be found at [Vue Transition](https://vuejs.org/guide/built-ins/transition.html#css-based-transitions).
:::
:::demo

View File

@ -16,17 +16,3 @@ import { ref } from 'vue'
const disabled = ref(false)
</script>
<style>
.slide-fade-enter-active {
transition: all 0.3s ease;
}
.slide-fade-leave-active {
transition: all 0.3s cubic-bezier(1, 0.5, 0.8, 1);
}
.slide-fade-enter,
.expand-fade-leave-active {
margin-left: 20px;
opacity: 0;
}
</style>

View File

@ -1,7 +1,22 @@
<template>
<el-tooltip content="I am an el-tooltip">
<el-tooltip content="I am an el-tooltip" transition="slide-fade">
<el-button>trigger me</el-button>
</el-tooltip>
</template>
<script lang="ts" setup></script>
<style>
.slide-fade-enter-active {
transition: all 0.3s ease-out;
}
.slide-fade-leave-active {
transition: all 0.8s cubic-bezier(1, 0.5, 0.8, 1);
}
.slide-fade-enter-from,
.slide-fade-leave-to {
transform: translateX(120px);
opacity: 0;
}
</style>