# 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: []

Fetching data from CMS.

  • Type: Function
  • Arguments:
    • url: Page URL slug
      • Type: String
    • locale: Locale (optional)
      • Type: String
      • Default: en_us
    • custom - Custom search config (use instead of url, optional)
      • Type: CustomSearch
      • Default: {}
    • customQuery - Custom GROQ query (see more GROQ docs (opens new window), optional)
      • Type: String,
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: ComputedProperty<Boolean>
  • Default: false

# error

Data fetching error object.

  • Type: ComputedProperty<any>
  • Default: {}

# RenderContent

Will render the CMS data to the Vue.js components.

<render-content :content="content" />

# content

Passing fetched CMS data.