added scroll to top on pagination change
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user