Compare commits
No commits in common. "d6e56afbe79237c881708422b27332e59712529d" and "602dca6ee67ca1f0ea1a287910c6261ecf5726a6" have entirely different histories.
d6e56afbe7
...
602dca6ee6
@ -2,7 +2,7 @@
|
|||||||
import customHeader from "@/components/customHeader/index.vue";
|
import customHeader from "@/components/customHeader/index.vue";
|
||||||
import customFooter from "@/components/customFooter/index.vue";
|
import customFooter from "@/components/customFooter/index.vue";
|
||||||
import { NScrollbar } from "naive-ui";
|
import { NScrollbar } from "naive-ui";
|
||||||
import { computed, watch, ref } from "vue";
|
import { computed } from "vue";
|
||||||
import { useRoute } from "vue-router";
|
import { useRoute } from "vue-router";
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
@ -55,18 +55,12 @@ const currentBg = computed(() => {
|
|||||||
// 兜底:当作颜色或直接背景
|
// 兜底:当作颜色或直接背景
|
||||||
return { background: value };
|
return { background: value };
|
||||||
});
|
});
|
||||||
|
|
||||||
const scrollbarRef = ref(null);
|
|
||||||
watch(route, () => {
|
|
||||||
scrollbarRef.value?.scrollTo({ top: 0 });
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="flex flex-col h-screen">
|
<div class="flex flex-col h-screen">
|
||||||
<customHeader></customHeader>
|
<customHeader></customHeader>
|
||||||
<n-scrollbar
|
<n-scrollbar
|
||||||
ref="scrollbarRef"
|
|
||||||
class="bg-cover bg-center bg-no-repeat flex-1"
|
class="bg-cover bg-center bg-no-repeat flex-1"
|
||||||
style="background-size: 100% 100%; background-attachment: fixed"
|
style="background-size: 100% 100%; background-attachment: fixed"
|
||||||
:style="currentBg"
|
:style="currentBg"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user