JSON:API implementation with Vue 3 + Pinia store.
pnpm install jsonapi-pinia
Firstly open your entry app inside src/main.js
and add jsonPinia inside your vue instance as a vue plugin.
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import jsonApi from 'jsonapi-pinia'
import './style.css'
import App from './App.vue'
const pinia = createPinia()
const app = createApp(App)
app.use(pinia)
app.use(jsonApi, {
pinia: pinia, // pinia instance
apiConf: {
baseUrl: 'http://localhost:3000/api/v1' // your base api url(optional)
}
})
app.mount('#app')