I am facing an issue with my vue.js
application that consists of a landing page, user dashboard, and admin dashboard. Each section has different states, but they all share a common shared
module with important data like page width, token, current user, etc.
The problem arises because vuex allows only one centralized store, meaning anyone visiting the landing page can view the entire structure of the store, posing a potential security risk.
An ideal solution would involve something along these lines:
store: Object.merge({}, SharedStore, UserDashboardStore),
And in another scenario:
store: Object.merge({}, SharedStore, AdminDashboardStore),
where the variable is an instance of Vuex.Store
.
However, this method does not work as expected. Are there any better alternatives to address this issue?