greenpress / vuex-composition-helpers

A util package to use Vuex with Composition API easily.
https://www.npmjs.com/package/vuex-composition-helpers
MIT License
288 stars 32 forks source link

Not working with nuxt #31

Open haron-IV opened 3 years ago

haron-IV commented 3 years ago

Hi. I was trying to use composition helpers in Nuxt project, but if I import it inside the component whole application dead immediately.

Here is code that I wrote

import { createNamespacedHelpers } from 'vuex-composition-helpers'
const { useState } = createNamespacedHelpers('app')
setup() {
const { getApplicationWidth } = useState([
      'appWidth'
])
}
davidmeirlevy commented 3 years ago

Have you implemented the change in the nuxt.config.js like mentioned in the documentation?

haron-IV commented 3 years ago

U mean about this section?

module.exports = {
  ...
  chainWebpack: config => {
    config
      .rule('ts')
      .include
      .add(/vuex-composition-helpers/)
  }
}
davidmeirlevy commented 3 years ago

@venglas look here at line 72:

https://github.com/greenpress/blog-front/blob/master/nuxt.config.js

dschreij commented 3 years ago

I think you specifically refer to adding the following segment to nuxt.config.js?

build: {
    transpile: [
      'vuex-composition-helpers'
    ]
  }