added scroll to top on pagination change

This commit is contained in:
Mamalizz
2025-02-28 23:07:46 +03:30
parent 6fa0017ca5
commit 91fc821576
+6 -1
View File
@@ -17,11 +17,16 @@ defineProps<Props>();
const params: any = inject("params");
const { y } = useWindowScroll({ behavior: "smooth" });
// computed
const page = computed({
get: () => (params?.page ? Number(params.page) : 1),
set: (value: number) => (params.page = value),
set: (value: number) => {
params.page = value;
y.value = 0;
},
});
</script>