[Vuejs]-Vuex createNamespacedHelpers is not working

2👍

You’re using an object property value shorthand, so your code snippet

window.vueRoot = new Vue({
  el: '#vue-root',
  store,
  someModuleNameSpaceHelper ,
  computed: {

  }
});

is equivalent to

window.vueRoot = new Vue({
  el: '#vue-root',
  store,
  someModuleNameSpaceHelper: someModuleNameSpaceHelper,
  computed: {

  }
});

which is like doing

window.vueRoot = new Vue({
  el: '#vue-root',
  store,
  someModuleNameSpaceHelper: {
    computed: {...}, // vue won't see this
    methods: {...}   // vue won't see this
  } ,
  computed: {

  }
});

How about changing it to

window.vueRoot = new Vue({
  el: '#vue-root',
  store,
  computed: someModuleNameSpaceHelper.computed,
  methods: someModuleNameSpaceHelper.methods
});

Leave a comment