0👍
For anyone who is in a similar situation, I ended up importing an empty vuex module and caching it to a variable, assigning new getter functions and then registering it, similar to this:
import emptyVuexModule from 'emptyModule'
let cachedModule = emptyVuexModule
cachedModule.getters[getterName] = new Function(['state'], getterContents)
this.$store.registerModule(cachedModule)
I don’t know if this is the best solution and I know using new Function comes with security issues, but it works for my needs.
- [Vuejs]-How do i use spread operator for multiple vuex modules?
- [Vuejs]-Render a date that comes asynchronous for each item in v-for
Source:stackexchange.com