Hooks
Import public template hooks from @/hooks. The hooks tied to components, useForm, useModal, useChart, and useFlow, come from @/components and are documented with each component. Import useRequest from @/axios.
| Task | Reference |
|---|---|
| Build menus, navigate, manage tabs, or add menu badges | Navigation and menus |
| Maximize, reload, or scroll the content area | Layout and scrolling |
| Set themes, language, or watermarks | Themes and localization |
| Implement pagination or context menus | Component interactions |
| Observe viewport size, fill the viewport, or work with dates | Viewport and dates |
| Capture or print DOM content | Capture and printing |
Create hooks that subscribe, listen, or register cleanup during setup() or within an active Vue effect scope. Capture, print, and fullscreen actions should run after DOM mount or on user interaction. BasicTarget accepts elements, refs, or getters. Vue and DOM targets
@/hooks/web/useI18n, @/hooks/web/useVueRouter, and @/hooks/web/usePagination remain as compatibility imports. Use @/hooks in new application code. Hook implementation and test index