only single click needed on summary now

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

@ -30,10 +30,6 @@
currentWorkingInstrument.value = instruments.value.find(instrument => instrument.name === currentWorkingCategory.value.instrument)
}
onMounted(loadData)
watch(currentWorkingInstrument, () => {
currentWorkingCategory.value = categories.value.find(category => category.instrument === currentWorkingInstrument.value.name)
})
</script>
<template>

@ -2,9 +2,14 @@
const props = defineProps(['instruments', 'categories'])
const currentWorkingCategory = defineModel('currentWorkingCategory')
const currentWorkingInstrument = defineModel('currentWorkingInstrument')
const selectFirstInstrumentOfCategory = () => {
currentWorkingCategory.value = props.categories.find(category => category.instrument === currentWorkingInstrument.value.name)
}
</script>
<template>
<select v-model="currentWorkingInstrument">
<select @change="selectFirstInstrumentOfCategory" v-model="currentWorkingInstrument">
<option :value="instrument" v-for="instrument in props.instruments">
{{instrument.name}}
</option>

Loading…
Cancel
Save