Closed aymasse closed 5 years ago
For now define your stores the old way:
@Module({ namespacedPath: "foo" })
export default class extends VuexModule { }
You can still define your Vuex-store the new way:
import FooStore from "@/foo/store";
const modules = { ...extractVuexModule(FooStore) };
export const store = new Vuex.Store({ modules });
I've closed #42 as it's another expression of this issue - thanks to @SaphuA for the workaround.
If it's useful, see see my repro - and run yarn build && yarn start
.
I think you setting namespaced
to a string should work.
const VuexModule = createModule({
namespaced: 'foo',
strict: false,
target: "nuxt",
})
Hello @aymasse
I've made an update based on the issue raised. Thanks to @vizv 's suggestion
interface VuexModuleOptions {
namespaced ?:string;
...
}
I've modified the namespaced
option to take only a string.
works perfectly now
Hello,
While using version
2.0.4
, module declaration is kind of broken in minified code due to the path being pulled from the class' name. Problem is, the class name is being mangled while usingvue-cli
in its default configuration.The result (for me) is that my store only has a single module (named
t
in my output), even if I declare several modules. This single module contains everystate property
of my modules but only themutations
andactions
of the last declared one.