animals: [
{
name: "spider",
params: [
"size",
"legsCount",
"weight"
]
},
{
name: "dog",
params: [
"weight",
"breed",
"height",
"color"
]
}
]
{
name: "spider",
params: {
"size": '1cm',
"legsCount": 8,
"weight": 8
}
},
<script>
export default {
data() {
return {
animals: [{
name: "spider",
params: {
size: '',
legsCount: '',
weight: ''
}
}, {
name: "dog",
params: {
weight: '',
breed: '',
height: '',
color: ''
}
}]
};
}
};
</script>
<template>
<form>
<fieldset v-for="animal of animals" :key="animal.name">
<legend>{{animal.name}}</legend>
<label v-for="(_, param) in animal.params" :key="`${animal.name}::${param}`">
<span>{{param}}:</span>
<input v-model="animal.params[param]">
</label>
</fieldset>
</form>
</template>