fixing issue with v-if and category chooser

practiced-songs
Matthew Huntington 1 year ago
parent 88583ddbfb
commit 404cbf12aa

@ -1,4 +1,6 @@
<script setup>
import { defineProps } from 'vue';
const props = defineProps(['instruments', 'categories'])
const currentWorkingCategory = defineModel('currentWorkingCategory')
const currentWorkingInstrument = defineModel('currentWorkingInstrument')
@ -16,9 +18,8 @@
</select>
<select v-model="currentWorkingCategory">
<option
v-show="category.instrument === currentWorkingInstrument.name"
:value="category"
v-for="category in props.categories">
v-for="category in props.categories.filter(currentCategory => currentCategory.instrument === currentWorkingInstrument.name)"
:value="category">
{{category.category}}
</option>
</select>

Loading…
Cancel
Save