|
|
|
|
@ -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>
|
|
|
|
|
|