If I have a button
<Button> Log me in! </Button>
, and I want to dynamically change its style based on the state of my Vuex app (state.user
is not null).
How should I properly implement this functionality?
I'm considering creating a field in the component's local state that holds the CSS class name and changing it as needed within actions and mutations. Is there a more appropriate place for handling this logic? Since this styling is specific to the component, I'm hesitant about storing it in the global state.