I need help on populating some input fields on a form with Vue 3. When a user selects an option in my dropdown the form should output the necessary inputs. Instead it will show all inputs from every option.
Here is my select dropdown
<select
v-model="selectedInverter"
@change="onChange($event)" >
<option
v-for="(item, index) in options"
:value="item.inverter"
:key="index" >
{{ item.inverter }}
</option>
</select>
And here are my options
export default {
name: "ExampleOptions",
data() {
return {
address: "",
stakeAddress: "",
selectedInverter: null,
addressError: "",
apiKey: null,
filteredOptions: "",
options: [
{
inverter: "None",
options: []
},
{
inverter: "Eagle",
options: [
{
name: "Cloud ID",
value: null,
description:
"The Rainforest cloud id used to access your system data",
type: "text",
required: true
},
{
name: "User",
value: null,
description: "The Rainforest cloud username",
type: "text",
required: true
},
{
name: "Password",
value: null,
description: "The Rainforest cloud password",
type: "password",
required: true
}
]
},
{
inverter: "Efergy",
options: [
{
name: "Token",
value: null,
description: "The Efergy token used to access your system data",
type: "text",
required: true
},
{
name: "Power",
value: null,
description:
"The Efergy power key, usually 'PWER' or 'PWER.1234' where 1234 is the sid",
type: "text",
required: true
}
]
}
]
};
},
And this is my codepen example: https://codepen.io/pistell/pen/BaJPjgq
As you can see all the dropdown examples are shown at all times. How can I get the ones selected in the dropdown to show? I'm also using Tailwind CSS if that makes a difference.