mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +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>
|
@ -5,5 +5,6 @@ import GlobalSider from './GlobalSider/index.vue';
|
||||
import GlobalContent from './GlobalContent/index.vue';
|
||||
import GlobalFooter from './GlobalFooter/index.vue';
|
||||
import GlobalLogo from './GlobalLogo/index.vue';
|
||||
import GlobalBackTop from './GlobalBackTop/index.vue';
|
||||
|
||||
export { SettingDrawer, GlobalHeader, GlobalTab, GlobalSider, GlobalContent, GlobalFooter, GlobalLogo };
|
||||
export { SettingDrawer, GlobalHeader, GlobalTab, GlobalSider, GlobalContent, GlobalFooter, GlobalLogo, GlobalBackTop };
|
||||
|
Reference in New Issue
Block a user