diff --git a/docs/content/1.getting-started/2.installation.md b/docs/content/1.getting-started/2.installation.md index 74ddb82..3fce766 100644 --- a/docs/content/1.getting-started/2.installation.md +++ b/docs/content/1.getting-started/2.installation.md @@ -25,6 +25,10 @@ yarn add nuxt-convex convex :: +::note +`nuxt-convex` ships with the recommended Vue integration (`convex-vue`), so you do not need to install it separately. +:: + Add the module to your Nuxt configuration: ```ts [nuxt.config.ts] diff --git a/docs/content/3.composables/5.use-convex-paginated-query.md b/docs/content/3.composables/5.use-convex-paginated-query.md new file mode 100644 index 0000000..2eb92cc --- /dev/null +++ b/docs/content/3.composables/5.use-convex-paginated-query.md @@ -0,0 +1,101 @@ +--- +title: useConvexPaginatedQuery +description: Paginate Convex queries with real-time updates. +--- + +Paginate a Convex query that returns a `PaginationResult`. This composable is **client-only** and subscribes to real-time updates. For SSR, use `useConvexQuery` and fetch a single page on the server. + +## Usage + +```vue [app/components/Tasks.vue] + + + +``` + +## Parameters + +| Parameter | Type | Description | +| --------- | ---------------------------- | ----------------------------------------------------- | +| `query` | `FunctionReference<'query'>` | The paginated Convex query to call. | +| `args` | `object` | Arguments for the query (excluding `paginationOpts`). | +| `options` | `{ numItems: number }` | Number of items per page. | + +## Return Values + +| Property | Type | Description | +| --------------- | ----------------------------------------------- | ------------------------------------------ | +| `data` | `ComputedRef` | Flattened list of all loaded pages. | +| `pages` | `ComputedRef` | Array of pages. | +| `lastPage` | `ComputedRef \| undefined>` | Last page result. | +| `isDone` | `Ref` | True when all pages are loaded. | +| `isLoading` | `ComputedRef` | True while the first page is loading. | +| `isLoadingMore` | `Ref` | True while loading additional pages. | +| `loadMore` | `() => void` | Load the next page. | +| `reset` | `() => void` | Clear pages and reload from the start. | +| `suspense` | `() => Promise` | Resolves when the first page is available. | + +## Components + +`nuxt-convex` also includes renderless components for template usage: + +### `` + +```vue + + + + + + +``` + +### `` + +```vue + + + + + + +``` diff --git a/docs/content/5.integrations/1.better-auth.md b/docs/content/5.integrations/1.better-auth.md index 48cfe7b..d74f17d 100644 --- a/docs/content/5.integrations/1.better-auth.md +++ b/docs/content/5.integrations/1.better-auth.md @@ -67,8 +67,8 @@ Export CRUD functions that the Better Auth adapter will call: import { createApi } from '@convex-dev/better-auth' import schema from './schema' -export const { create, findOne, findMany, updateOne, updateMany, deleteOne, deleteMany } = - createApi(schema, () => ({})) +export const { create, findOne, findMany, updateOne, updateMany, deleteOne, deleteMany } + = createApi(schema, () => ({})) ``` ### 7. Add Auth Tables to Schema @@ -156,7 +156,9 @@ const { user, signIn, signOut } = useUserSession()