Setup Axios

This plugin gives you useful functions which is extending the Repository

Install Pinia ORM Axios Plugin

Yarn
yarn add @pinia-orm/axios
NPM
npm install @pinia-orm/axios --save
PNPM
pnpm add @pinia-orm/axios

Adding the plugin to your pinia ORM store

You have to options here to use the plugin. Either you use createPiniaOrmAxios(options?: PinaOrmPluginOptions) or you use pinaOrmPluginAxios. It depends if you want to pass options on initialization or later.

Vue3
import { createPinia } from 'pinia'
import { createORM } from 'pinia-orm'
import { createPiniaOrmAxios } from '@pinia-orm/axios'
import axios from 'axios'
const pinia = createPinia()
const piniaOrm = createORM()
piniaOrm().use(createPiniaOrmAxios({
  axios
}))
pinia.use(piniaOrm)
Vue2
import { createPinia, PiniaVuePlugin } from 'pinia'
import { createORM } from 'pinia-orm'
import { createPiniaOrmAxios } from '@pinia-orm/axios'
import axios form 'axios'
Vue.use(PiniaVuePlugin)
const pinia = createPinia()
const piniaOrm = createORM()
piniaOrm().use(createPiniaOrmAxios({
  axios
}))
pinia.use(piniaOrm)