# Api Reference
# useContent
Provides full handling for CMS data fetching.
const { content, search, loading, error } = useContent(id)
# content
Storing fetched data from CMS.
- Type:
Array
- Default:
[]
# search
Fetching data from CMS.
- Type:
Function
- Arguments:
url
: Page URL slug- Type:
String
- Type:
id
- Entry ID (use instead ofurl
)- Type:
String
- Type:
type
: Content Type (optional)- Type:
String
- Default:
page
- Type:
locale
: Locale (optional)- Type:
String
- Default:
en
- Type:
includeReference
- Array of content references (optional)- Type:
String[]
- Type:
custom
- Custom search config (use instead ofurl
orid
, optional)- Type:
CustomSearch
- Default:
{}
- Type:
customQuery
- accepts object of Contentstack query (opens new window)- Type:
any
- Default:
{}
- Type:
includeCount
- Return multiple entries with total count (optional)- Type:
Boolean
- Type:
limit
- paginate the output of a request (requireincludeCount=true
, optional)- Type:
Number
- Type:
skip
- skip a specific number of entries in the output (requireincludeCount=true
, optional)- Type:
Number
- Type:
orderDir
- sort direction (requireincludeCount=true
andorderField
, optional)- Type:
asc
|desc
- Type:
orderField
- sort field (requireincludeCount=true
andorderDir
, optional)- Type:
String
- Type:
livePreviewQuery
- Live Preview query parameters- Type:
unknown
- Type:
CustomSearch: {
type: string // name of custom type
field: string // name of field to search
value: string // value of field to search
}
includeReference: [
'content.reference.content', // root level references
'content.group.items.item.content.reference.content', // nested content references (example)
],
# loading
Data fetching loading indicator.
- Type:
Boolean
- Default:
false
# error
Data fetching error object.
- Type:
Object
- Default:
{}
# RenderContent
Will render the CMS data to the Vue.js components.
<render-content :content="content" />
# content
Passing fetched CMS data.
- Type:
Array
- Default:
[]
- Behavior: Prop (opens new window)