@anweb/nuxt-ancore
Ancore module for Nuxt
A set of composables, components and utilities for Nuxt to handle common tasks: data fetching with SSR, paginated lists, form validation, dialogs, i18n and more.
Setup
npm i @anweb/nuxt-ancore
export default defineNuxtConfig({
modules: ['@anweb/nuxt-ancore']
})
Configuration
Options can be set inline under the ancore key in nuxt.config, or extracted
into a standalone ancore.config.ts at the project root:
// ancore.config.ts
import { defineAncoreConfig } from '@anweb/nuxt-ancore'
export default defineAncoreConfig({
api: '~/utils/api',
i18n: {
lng: 'en',
fallbackLng: 'en',
resources: {
en: { translation: '~~/locales/en.json' }
}
}
})
Both sources are merged; values set inline in nuxt.config override the file.
Composables
| Name | Description |
|---|---|
useAnData |
Data fetching with SSR/CSR support, URL params, query and auto-refresh |
useAnList |
Paginated lists with infinite scroll, filters and reverse mode |
useAnForm |
Form state, validation (async-validator), history and diff tracking |
useAnDialogs |
Dynamic dialogs: open, close, closeAll, swipe-to-dismiss |
useAnI18n |
i18next integration with per-component namespaces and language switching |
useAnEventBus |
SSR-safe useEventBus wrapper with a typed, predefinable channel registry |
Components
| Name | Description |
|---|---|
AnTab |
Headless tab with lazy rendering and state preservation via display: none |
AnDropdown |
Dropdown with CSS Anchor Positioning, teleport and ARIA. match-width sizes the menu to the trigger |
Utilities
| Name | Description |
|---|---|
toQuery |
Converts an object to a URL query string, filtering out null/undefined |
asyncInit |
SSR-aware init helper: awaits during SSR, fires without await on CSR |
coreApi |
Core API wrapper around $fetch; infers the response type from the Nitro route and method |
userApi |
Routes through the app's api when configured, otherwise coreApi; same inference |
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 1.20.1 | MIT | ||
| 1.20.0 | MIT | ||
| 1.19.0 | MIT | ||
| 1.18.0 | MIT | ||
| 1.17.1 | MIT | ||
| 1.17.0 | MIT | ||
| 1.16.16 | MIT | ||
| 1.16.15 | MIT | ||
| 1.16.14 | MIT | ||
| 1.16.13 | MIT | ||
| 1.16.12 | MIT | ||
| 1.16.11 | MIT | ||
| 1.16.10 | MIT | ||
| 1.16.9 | MIT | ||
| 1.16.8 | MIT | ||
| 1.16.7 | MIT | ||
| 1.16.6 | MIT | ||
| 1.16.5 | MIT | ||
| 1.16.4 | MIT | ||
| 1.16.3 | MIT | ||
| 1.16.2 | MIT | ||
| 1.16.1 | MIT | ||
| 1.16.0 | MIT | ||
| 1.15.11 | MIT | ||
| 1.15.10 | MIT | ||
| 1.15.9 | MIT | ||
| 1.15.8 | ^3.0 | MIT | |
| 1.15.7 | ^3.0 | MIT | |
| 1.15.6 | ^3.0 | MIT | |
| 1.15.5 | ^3.0 | MIT |
Showing the latest 30 of 99. See every release on npm