mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-12-27 15:50:17 +08:00
feat(projects): 增加返回顶部功能
This commit is contained in:
13
src/layouts/common/GlobalBackTop/index.vue
Normal file
13
src/layouts/common/GlobalBackTop/index.vue
Normal file
@@ -0,0 +1,13 @@
|
||||
<template>
|
||||
<n-back-top :show="show" class="z-1000" />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed } from 'vue';
|
||||
import { useWindowScroll } from '@vueuse/core';
|
||||
|
||||
const { y: scrollY } = useWindowScroll();
|
||||
|
||||
const show = computed(() => scrollY.value > 180);
|
||||
</script>
|
||||
<style scoped></style>
|
||||
Reference in New Issue
Block a user