My experience with learning Vue.js has been great, but I keep encountering a problem where setting a data property based on state doesn't update the component when the state changes.
For instance...
Check out these code snippets
<router-link v-if="!isDisabled" :to="{ path: '/effects' }">
<button class="stepButton" :class="{ disabled: false }">Next</button>
</router-link>
<button v-else class="stepButton" :class="{ disabled: isDisabled }">Next</button>
data: function(){
return {
ailmentsLib: [
"Chronic Pain",
"Migraines",
"Muscle Spasms",
"Stress",
"Vertigo",
"Nausea"
],
search: '',
searchMatch: true,
ailments: [
"Chronic Pain",
"Migraines",
"Muscle Spasms",
"Stress",
"Vertigo",
"Nausea"
],
isDisabled: this.$store.state.ailment.length < 1 ? true : false
}
}
While I can see the state changing in my vue inspector, the button remains disabled.