带嵌套v环的动态v模型

时间:2020-05-03 17:27:40

标签: vue.js

我被困在建立动态表单v模型中。我需要在data [idx] .qty中循环显示它的输入数量。以下是示例json数据:

 const data = [ {name: "INDIVIDUAL 7KM",price: "50",qty: 1},{name: "INDIVIDUAL 7KM",price: "50",qty: 3} ]

以下是组件:

  <div v-bind:key="item[i]" v-for="(item,i) in participantData">
        <el-card
            class="box-card"
            :model="form"
            v-bind:key="koko"
            v-for="(koko,idx) in item.qty"
             style="margin-top:2rem; width :100%">
                  <el-input v-model="form.participants[item.name + koko]"></el-input> </el-card> </div>

0 个答案:

没有答案