Currently building a large scale website with Vue.js, been stuck in the architecture of Vuex store.
The folder structure now looks like this
.
├── build
├── src
│ └── components
│ ├── Header.vue
│ └── TimeStamp.vue
│ └── Photo.vue
│ └── pages
│ ├── index.vue
│ └── about.vue (includes Header.vue, Thumbnail.vue)
├── store
│ └── index.js
│ └── modules
│ ├── Header.js
│ └── TimeStamp.js
│ └── Photo.js
Basically my code pattern is each component has a corresponding module store, but it seems all module state need to be imported as a big SINGLE object, that's the point confuses me now, because it means even in a page doesn't require TimeStamp component, the TimeStamp state still exist in scope, and let's say if I have hundreds of states total, but I only need Header.js store, so all the others are actually useless.
Therefore, my question is:
Is it possible to create dynamic state object for each page. For example, in About page, only import
Header.jsandPhoto.js, in Index page, only importHeader.jsandTimeStamp.js, and the structure would look similar like below.
├── store
│ └── pages
│ ├── Index.js
│ └── About.js
│ └── News.js
│
│ └── modules
│ ├── Header.js
│ └── TimeStamp.js
│ └── Photo.js