Repository

Pinia ORM Axios adds supporting properties and methods to the Model object.

Static Properties

axios

  • Type: AxiosInstance | null
    The axios instance which was either set during plugin installation or set using the setAxios method. Pinia ORM Axios will use this axios instance to perform requests.

apiConfig

  • Type: Object
  • Default: {}
    The property that holds the model configuration for requests.

globalApiConfig

  • Type: Object
    The property that holds the global configuration. The value will be set automatically during the plugin installation process.

::: warning WARNING Do not mutate this property programmatically. :::

Static Methods

api

  • api(): Request
    Return a newly created Request instance.

setAxios

  • setAxios(axios: AxiosInstance): void
    Set the axios instance manually. Typical setups will configure the axios instance during installation. However, in some cases (mostly with Nuxt), you may need to set the axios instance at a later stage.
    ::: warning IMPORTANT If you omit the axios instance during installation, it's important that one is set using setAxios before any attempt to make an API request. :::
    See also: Nuxt.js Integration