API Reference
ConvexQuery
Reference for the Nuxt renderless component that wraps useConvexQuery.
ConvexQuery is a Nuxt-only global component that renders query states through slots.
Example
app/pages/tasks.vue
<script setup lang="ts">
import { api } from '#convex/api'
</script>
<template>
<ConvexQuery :query="api.tasks.list" :args="{ userId: 'user_123' }">
<template #loading>
Loading tasks...
</template>
<template #error="{ error }">
{{ error.message }}
</template>
<template #empty>
No tasks yet.
</template>
<template #default="{ data }">
<ul>
<li v-for="task in data" :key="task._id">
{{ task.title }}
</li>
</ul>
</template>
</ConvexQuery>
</template>
Props
| Prop | Type | Meaning |
|---|---|---|
query | FunctionReference<'query'> | Query reference |
args | FunctionArgs<Query> | Query arguments |
options | UseConvexQueryOptions | Same options accepted by useConvexQuery |
suspense | boolean | Forces an explicit await before render |
Slots
loadingerroremptydefault
Behavior
- Uses
useConvexQueryinternally - On the server, waits for the first result when SSR is enabled
- Treats
undefinedand an empty array as empty states