I'm limited with the code I could show, but I am trying to use a V-If statement based on a value in the vuex store.
We're working with component API and typescript.
The partial code from the DataStore.ts:
export const store = createStore<state>({
state: {
errorOrderPending: false
},
mutations: {
setErrorOrderPending(state, newVale: boolean) {
state.errorOrderPending = newVale;
}
}
});
export function useStore() {
return baseUseStore(key);
}
In the component, I'm importing the store and useStore.
<template>
<div class="modal" >
<p>Show modal</p>
</div>
</template>
I tried to do:
<div v-if="$store.state.errorOrderPending" class="modal" >
But it's not working.
I wish I can share the code but I can't but this is basically what is happening.
Thanks