CodeDredd / pinia-orm

The Pinia plugin to enable Object-Relational Mapping access to the Pinia Store.
https://pinia-orm.codedredd.de/
MIT License
452 stars 39 forks source link

Documentation for Nuxt 3 @pinia-orm/axios integration. #1804

Open georgyKurian opened 6 months ago

georgyKurian commented 6 months ago

Describe the feature

I was trying to use pinia-orm axios plugin with Nuxt3 project. I couldn't find any documentation or examples on how to integrate in Nuxt 3 projects. I tried creating using below plugin code, but it didnt work for me.

import { createORM } from 'pinia-orm';
import { setActivePinia } from 'pinia';
import { defineNuxtPlugin } from '#app';

import { piniaOrmPluginAxios } from '@pinia-orm/axios';

export default defineNuxtPlugin((nuxtApp) => {
  const piniaOrm = createORM();
  piniaOrm().use(piniaOrmPluginAxios);
  nuxtApp.$pinia.use(piniaOrm);
  setActivePinia(nuxtApp.$pinia);
});

Having a documentation or an example for this would be good.

Additional information

Final checks

maarten-mald-digital commented 5 months ago

Would also like to know how to implement in Nuxt