Answer the question
In order to leave comments, you need to log in
Doesn't output v-for through an array?
There is a layout:
<el-form :model="gameMode" :rules="rules" ref="gameMode" label-width="200px" class="demo-ruleForm">
<el-col class="col-time" :span="3" v-for="(day,index) in days" :key="day">
<el-row :gutter="20">
<el-col>
<div class="grid-content bg-purple">{{day}}</div>
</el-col>
</el-row>
<el-row :gutter="20" v-for="(item,index2) in gameMode.shedules[index]" :key="index2">
<el-col>
<el-form-item :prop="'shedules.'+index+'.' + index2" :rules="{required:true, message: 'Required', trigger: 'blur'}">
<el-input v-model="gameMode.shedules[index][index2]" v-mask="'##:##'"></el-input>
<el-button class="btn-delete" type="danger" size="mini" icon="el-icon-delete" circle v-on:click="gameMode.shedules[index].splice(index2, 1)"></el-button>
</el-form-item>
</el-col>
</el-row>
<el-button type="primary" icon="el-icon-plus" circle @click="addTime(index)"></el-button>
</el-col>
<el-form/>
gameMode: {
shedules:[
[],
[],
[],
[],
[],
[],
[]
]
}...
addTime(index){
if(!this.gameMode.shedules[index])
this.gameMode.shedules[index] = [];
this.gameMode.shedules[index].push('');
}
Answer the question
In order to leave comments, you need to log in
I solved the problem, in the array, due to fetch () from php, the array was overwritten, and as a result, the variable that was in gameMode was not obtained,
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question