# 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
    • id - Entry ID (use instead of url)
      • Type: String
    • preview - Preview URL, none cached (optional)
      • Type: String
    • locale - Locale KEY, localization key (optional)
      • Type: String
    • custom - Custom search config (use instead of url or id, optional)
      • Type: CustomSearch
      • Default: {}
CustomSearch: {
  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.