Sometimes we need to create modules at runtime, for example depending on a condition. We could even want to lazy load that module by using Webpack’s code splitting feature.
This lesson shows how to lazy load a Vuex module under a determined condition using TypeScript.
1:46: object spread operator != (object) destructuring assignment
Sorry to be nitpicking, but this is the second time the two are mixed up in this series.
Hi, just a quick question. Is it okay to import(lazy load) vuex states in the router? Like so
beforeEnter: (to, from, next) => {
import("@/store/accounts")
.then(({ accounts }) => {
store.registerModule("accounts", accounts);
})
.then(() => {
next();
});
}