JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://npmcdn.com/vue/dist/vue.js"></script>
<div id="app">
<select v-model="selectedProduct" @change="setSelectsToDefault">
<option value=""></option>
<option v-for="(level1,index) in products"
:key="index"
:value="level1">{{level1.name}}</option>
</select>
<select v-model="selectedInjection" @change="setShowSelectedInjection">
<option v-for="(match,i) in haufigkeitMatches"
:key="i"
:value="match.value" >{{ match.name }}</option>
</select>
<table>
<tr>
<td class="table-result-body-ipJahr"><div class="hideResult" v-show="showSelectedInjection && selectedProduct != ''">{{Math.round(selectedInjection)}}</div></td>
</tr>
</table>
</div>
Vue
"use strict";
new Vue({
el: '#app',
data: {
selectedPreisProIE: [],
selectedIeProKg: [],
selectedGewicht: [],
selectedInjection: null,
selectedProduct: null,
showSelectedInjection: false,
dataJson: [],
products: [{
name: "ivi",
Hint: "45-60 IE/kg alle 5 Tage\n60 IE 1x/Woche\n30-40 IE 2 x/Woche",
frequency: [1, 2, 8]
}, {
name: "ynovi",
Hint: "40-50 IE/kg\n2x/Woche im Abstand\nvon 3-4 Tagen",
frequency: [2, 6, 7]
}, {
name: "octa",
Hint: "50 (25-65) IE/kg\nalle 3-5 Tage",
frequency: [6, 7, 8]
}, {
name: "eroct",
Hint: "50 IE/kg \nalle 4 Tage",
frequency: [7]
}, {
name: "ltry",
Hint: "20-40 I.E./kg\n2-3x/Woche",
frequency: [2, 3]
}, {
name: "ate",
Hint: "20-40 I.E./kg\nAlle 2-3 Tage",
frequency: [5, 6]
}, {
name: "Facto A",
Hint: "20-40 I.E./kg\nAlle 2-3 Tage",
frequency: [5, 6]
}, {
name: "Eight",
Hint: "40-60 I.E./kg \nJeden 3.Tag oder\n2x/Woche",
frequency: [2, 3, 5, 6]
}, {
name: "iq_Vima",
Hint: "20-40 I.E./kg\nAlle 2-3 Tage",
frequency: [5, 6]
}, {
name: "Afla",
Hint: "20-50 I.E./kg\n2-3x/Woche",
frequency: [2, 3]
}, {
name: "Pma",
Hint: "20-40 I.E./kg\nAlle 2-3 Tage",
frequency: [5, 6]
}, {
name: "others",
Hint: "Individuell",
frequency: [1, 2, 3,...