I have a projects view that contains 3 components, <project-item>
, <project-list>
and <project-view>
. All of these components need to be aware of the selected projects.
<project-item>
holds the state for a particular project. This component has a property called selected which determines if the project is selected or not.<project-list>
houses one or more project-items and has a computed property which checks the children are of type<project-item>
and which items are selected.<project-view>
is the general view which just contains navigation and logic associated UAC.
The hierarchy looks like this...
<project-view>
<project-list>
<project-item selected></project-item>
</project-list>
</project-view>
What would be the best way of sharing that state as i feel vuex is the wrong choice here as it's not global state.
I also have tried to use a computed property on the <project-view>
component to get the selected items on the <project-list>
component but it throws errors despite existing and being in scope.