Open codeZoon opened 1 year ago
have the same Issue. Is there any solution ?
你的邮件我已收到!
@codeZoon and @cananaucristian, you could downgrade to version 4.0.2. I just checked, and dynamic module registration works fine on this version.
@ahovbok thank you, i have done that already but i want the issue to be fixed and i want to know why is that not working.
I think i have a similar problem, not sure, since it's in a big project, and I haven't really bothered to reproduce it in a smaller scale. A workaround i found that works for my scenario, is to use a function in the getter then it works. Again, not sure, if it's the same issue. And even if the workaround works, it would be nice if this would be fixed.
I'm facing the same issue in 4.1.0 but in my project this happens randomly so its much annoying. hopefully we'll get a fix
Version
"vuex": "^4.1.0"
Describe the bug
After registering the module dynamically, devtool shows that the state and getters are recomputed, but the getter-related views are not updated.
Reproduction
` / /src/store/index.ts / import { createStore } from "vuex";
export const store = createStore({ state() { return { count: 0 } },
getters: { double(state) { return state.count * 2; } },
mutations: { increment(state, num) { state.count += num; }, decrement(state, num) { state.count -= num; } } }); `
` / /src/main.ts / import { createApp } from 'vue'; import App from './App.vue'; import { store } from './store';
createApp(App).use(store).mount('#app'); `
` / /src/App.vue /
count: {{ count }} => double: {{ double }}
`
Expected behavior
The view associated with the getter should be updated.
Additional context
No response
Validations