Closed ludo1960 closed 5 years ago
Answer was here https://github.com/mrichar1/jsonapi-vuex/issues/13
To summorise:
Create jsonapi-vuex.js in plugins directory:
`import { jsonapiModule } from 'jsonapi-vuex'
export default function({ $axios, store }) {
store.registerModule('jv', jsonapiModule($axios))
}
Make sure your nuxt.config.js has the following:
plugins: [
'~/plugins/jsonapi-vuex.js'
],
and:
build: { /* ** You can extend webpack config here */ transpile: ['jsonapi-vuex'], extend (config, ctx) { } }
Hello there,
I am following the advice given here to use your very nice module with nuxt. I created the jsonapi-vuex.js plugin and edited the nuxt config, I get the following error:
Could not find a declaration file for module 'jsonapi-vuex'. '/var/vue/nuxt2/node_modules/jsonapi-vuex/index.js' implicitly has an 'any' type. Try
npm install @types/jsonapi-vuex
if it exists or add a new declaration (.d.ts) file containingdeclare module 'jsonapi-vuex';
ts(7016) Could not find a declaration file for module 'jsonapi-vuex'. '/var/vue/nuxt2/node_modules/jsonapi-vuex/index.js' implicitly has an 'any' type. Trynpm install @types/jsonapi-vuex
if it exists or add a new declaration (.d.ts) file containingdeclare module 'jsonapi-vuex';
ts(7016)I'm new to vue.js, I'm guessing I have to add your module to my config somewhere, but where?