I am enjoying learning Vue.js however I tend to keep running into the issue that when I set a data property based on state that it doesn't update the component if state changes.
For example...
Here are the 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
}
}
I have the state as changing in my vue inspector but the button doesn't become enabled.