Utilizing Vue.js for my project.
I am working with two object arrays, category
and categoryPar
. The category
array contains names and parent names, while the categoryPar
array only contains names. My goal is to display only the categories that belong to the selected parent category. Here's how I am attempting to achieve this:
<select v-model="editing.categoryPar"">
<option v-for="cat in categoryPar" v-bind:value="cat.name">{{ cat.description }}</option>
</select>
<select v-model="editing.category">
<option v-for="cat in category" v-if="editing.categoryPar == cat.par_name" v-bind:value="cat.name">{{ cat.description }}</option>
</select>
The condition is met but it does not re-render. However, when I use vue.$forceUpdate(); in the console, it works temporarily until I change the parent selection.
Appreciate any help you can provide.