Skip to content

Vue 3

ts
import { useBreakpoints, useElementSize, useEventListener, useNow, useWindowSize } from "@fast-china/utils";
import { useTemplateRef } from "vue";

const elementRef = useTemplateRef<HTMLElement>("element");
const { width: windowWidth } = useWindowSize();
const { width: elementWidth } = useElementSize(elementRef);
const now = useNow();
const breakpoints = useBreakpoints({ desktop: 1280, mobile: 0, tablet: 768 });
useEventListener(document, "visibilitychange", () => console.log(document.visibilityState));

The package provides lightweight native-backed browser composables, Vue 3 app.use() registration, typed props/emits/slots, and TSX rendering. Browser composables clean up with the current Vue scope; advanced scheduling, controls, SSR configuration, and device APIs remain outside this package. Vue remains external to the build and is required as a peer dependency.