mirror of
https://github.com/hay-kot/homebox.git
synced 2024-11-24 17:45:41 +00:00
attempt to fix scroll behavior
This commit is contained in:
parent
59ebf0af73
commit
7c240a563b
5 changed files with 7 additions and 18 deletions
|
@ -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");
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in a new issue