# 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:
type: Content type name- Type:
String - Example:
page - Default:
page
- Type:
id- Entry ID (use instead ofurl)- Type:
String
- Type:
locale- Locale (optional)- Type:
String - Default:
en
- Type:
include- Include level of nested entries (optional)- Type:
Number - Default:
3
- Type:
custom- Custom search config (use instead ofurlorid, optional)- Type:
CustomSearch - Default:
{}
- Type:
environment- Contentful enviroment- Type:
String - Default:
master
- Type:
preview- Triggers fetching data from Contentful Preview API- Type:
Boolean - Default:
false
- Type:
CustomSearch: {
type: string // name of custom type
field: string // name of field to search
value: string // value of field to search
}
# 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)