Setup Axios
This plugin gives you useful functions which is extending the Repository
Install Pinia ORM Axios Plugin
Yarn
yarn 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({
plugins: [
createPiniaOrmAxios({
axios,
}),
],
})
pinia.use(piniaOrm)