963 markdown files reformatted with the repository's pinned prettier so pnpm format:check covers the folded tree like every other repo file. The formatter's embedded-language pass also normalized code fences (TS semicolons, closed HTML tags in examples, lowercased CSS hex colors, one renumbered list that skipped an index). Alphanumeric token deltas vs the fold commit were audited file-by-file; all are formatter-equivalent markup normalizations plus the four sanitized skills.
1.1 KiB
1.1 KiB
category
| category |
|---|
| Elements |
useWindowScroll
Reactive window scroll
Usage
<script setup lang="ts">
import { useWindowScroll } from '@vueuse/core';
const { x, y } = useWindowScroll();
</script>
<template>
<div>read current x, y scroll: {{ x }}, {{ y }}</div>
<button @click="x = 100">scroll X to 100</button>
<button @click="y = 100">scroll Y to 100</button>
</template>
Type Declarations
export interface UseWindowScrollOptions extends ConfigurableWindow, UseScrollOptions {}
/**
* Reactive window scroll.
*
* @see https://vueuse.org/useWindowScroll
* @param options
*/
export declare function useWindowScroll(options?: UseWindowScrollOptions): {
x: WritableComputedRef<number, number>;
y: WritableComputedRef<number, number>;
isScrolling: ShallowRef<boolean, boolean>;
arrivedState: {
left: boolean;
right: boolean;
top: boolean;
bottom: boolean;
};
directions: {
left: boolean;
right: boolean;
top: boolean;
bottom: boolean;
};
measure(): void;
};
export type UseWindowScrollReturn = ReturnType<typeof useWindowScroll>;