Skip to content

Commit 54d7d4e

Browse files
committed
feat: backtop 添加动画
1 parent da90f93 commit 54d7d4e

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

src/lib/backtop/index.vue

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
11
<template>
2-
<div
3-
v-if="visible"
4-
class="jw-backtop"
5-
:style="{
6-
right: right + 'px',
7-
bottom: bottom + 'px',
8-
}"
9-
@click.stop="handleClick"
2+
<transition
3+
leave-active-class="animate__bounceOut"
4+
enter-active-class="animate__bounceIn"
105
>
11-
<slot>
12-
<jw-icon :size="26">
13-
<BackToTop />
14-
</jw-icon>
15-
</slot>
16-
</div>
6+
<div
7+
v-if="visible"
8+
class="jw-backtop animate__animated"
9+
:style="{
10+
right: right + 'px',
11+
bottom: bottom + 'px',
12+
}"
13+
@click.stop="handleClick"
14+
>
15+
<slot>
16+
<jw-icon :size="26">
17+
<BackToTop />
18+
</jw-icon>
19+
</slot>
20+
</div>
21+
</transition>
1722
</template>
1823

1924
<script setup lang="ts">

0 commit comments

Comments
 (0)