diff --git a/src/views/index/size1920/index.vue b/src/views/index/size1920/index.vue index 3400523..6513488 100644 --- a/src/views/index/size1920/index.vue +++ b/src/views/index/size1920/index.vue @@ -2,7 +2,7 @@ import customHeader from "@/components/customHeader/index.vue"; import customFooter from "@/components/customFooter/index.vue"; import { NScrollbar } from "naive-ui"; -import { computed } from "vue"; +import { computed, watch, ref } from "vue"; import { useRoute } from "vue-router"; const route = useRoute(); @@ -55,12 +55,18 @@ const currentBg = computed(() => { // 兜底:当作颜色或直接背景 return { background: value }; }); + +const scrollbarRef = ref(null); +watch(route, () => { + scrollbarRef.value?.scrollTo({ top: 0 }); +})