greenpress / vuex-composition-helpers

A util package to use Vuex with Composition API easily.

Home Page:https://www.npmjs.com/package/vuex-composition-helpers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not working with nuxt

haron-IV opened this issue · comments

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'
])
}

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

U mean about this section?

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

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

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