mirror of
https://github.com/sysadminsmedia/homebox.git
synced 2025-12-21 13:23:14 +01:00
attempt to fix scroll behavior
This commit is contained in:
@@ -1,14 +0,0 @@
|
|||||||
import type { RouterConfig } from "@nuxt/schema";
|
|
||||||
|
|
||||||
export default <RouterConfig>{
|
|
||||||
scrollBehavior(to, from, savedPosition) {
|
|
||||||
console.log(to, from, savedPosition);
|
|
||||||
if (savedPosition) {
|
|
||||||
return savedPosition;
|
|
||||||
} else {
|
|
||||||
return {
|
|
||||||
top: 0,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
@@ -56,7 +56,6 @@
|
|||||||
const calcWidth = ref(0);
|
const calcWidth = ref(0);
|
||||||
|
|
||||||
function resize() {
|
function resize() {
|
||||||
console.log("resize", el.value?.offsetHeight, el.value?.offsetWidth);
|
|
||||||
calcHeight.value = el.value?.offsetHeight || 0;
|
calcHeight.value = el.value?.offsetHeight || 0;
|
||||||
calcWidth.value = el.value?.offsetWidth || 0;
|
calcWidth.value = el.value?.offsetWidth || 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,5 +13,4 @@ export default defineNuxtConfig({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
css: ["@/assets/css/main.css"],
|
css: ["@/assets/css/main.css"],
|
||||||
plugins: [],
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -39,8 +39,6 @@
|
|||||||
const hasNext = computed(() => page.value * pageSize.value < total.value);
|
const hasNext = computed(() => page.value * pageSize.value < total.value);
|
||||||
const hasPrev = computed(() => page.value > 1);
|
const hasPrev = computed(() => page.value > 1);
|
||||||
|
|
||||||
const itemsTitle = ref<HTMLDivElement>();
|
|
||||||
|
|
||||||
function prev() {
|
function prev() {
|
||||||
page.value = Math.max(1, page.value - 1);
|
page.value = Math.max(1, page.value - 1);
|
||||||
}
|
}
|
||||||
|
|||||||
7
frontend/plugins/scroll.client.ts
Normal file
7
frontend/plugins/scroll.client.ts
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
export default defineNuxtPlugin(nuxtApp => {
|
||||||
|
nuxtApp.hook("page:finish", () => {
|
||||||
|
console.log(document.body);
|
||||||
|
document.body.scrollTo({ top: 0 });
|
||||||
|
console.log("page:finish");
|
||||||
|
});
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user