feat(projects): 返回顶部功能适配新布局

This commit is contained in:
燕博文 2023-03-14 13:50:23 +08:00
parent 42e6de395f
commit 54e2cb51cf
3 changed files with 3 additions and 27 deletions

View File

@ -30,7 +30,7 @@
<global-footer /> <global-footer />
</template> </template>
</admin-layout> </admin-layout>
<global-back-top /> <n-back-top :key="theme.scrollMode" :listen-to="`#${app.scrollElId}`" class="z-100" />
<setting-drawer /> <setting-drawer />
</template> </template>
@ -38,15 +38,7 @@
import { AdminLayout } from '@soybeanjs/vue-materials'; import { AdminLayout } from '@soybeanjs/vue-materials';
import { useAppStore, useThemeStore } from '@/store'; import { useAppStore, useThemeStore } from '@/store';
import { useBasicLayout } from '@/composables'; import { useBasicLayout } from '@/composables';
import { import { GlobalContent, GlobalFooter, GlobalHeader, GlobalSider, GlobalTab, SettingDrawer } from '../common';
GlobalBackTop,
GlobalContent,
GlobalFooter,
GlobalHeader,
GlobalSider,
GlobalTab,
SettingDrawer
} from '../common';
defineOptions({ name: 'BasicLayout' }); defineOptions({ name: 'BasicLayout' });

View File

@ -1,15 +0,0 @@
<template>
<n-back-top :show="show" class="z-1000" />
</template>
<script lang="ts" setup>
import { computed } from 'vue';
import { useWindowScroll } from '@vueuse/core';
defineOptions({ name: 'GlobalBackTop' });
const { y: scrollY } = useWindowScroll();
const show = computed(() => scrollY.value > 180);
</script>
<style scoped></style>

View File

@ -5,6 +5,5 @@ import GlobalSider from './global-sider/index.vue';
import GlobalContent from './global-content/index.vue'; import GlobalContent from './global-content/index.vue';
import GlobalFooter from './global-footer/index.vue'; import GlobalFooter from './global-footer/index.vue';
import GlobalLogo from './global-logo/index.vue'; import GlobalLogo from './global-logo/index.vue';
import GlobalBackTop from './global-back-top/index.vue';
export { SettingDrawer, GlobalHeader, GlobalTab, GlobalSider, GlobalContent, GlobalFooter, GlobalLogo, GlobalBackTop }; export { SettingDrawer, GlobalHeader, GlobalTab, GlobalSider, GlobalContent, GlobalFooter, GlobalLogo };