How does Element-ui verify the start time and end time of the el-date-picker control in the multi-layer table and pass the value

Here encountered the problem of the size of the verification time between the multi-layer tables, the time control is added to the onchange event. Add $event to pass the value, and then the scope is all the values ​​of the current layer of table. Simple and clear, look at the console.log(scope) if you don't understand.

<el-table-column label="开始时间" align="center">
                                    <template slot-scope="scope">
                                        <el-form :model="scope.row" :rules="rules" ref="scope.row">
                                            <el-form-item prop="startTime">
                                                <el-date-picker v-model="scope.row.startTime"
                                                                :picker-options="pickerOptionsKS"
                                                                class="table_input_time"
                                                                style="margin-top: 20px;" type="date"
                                                                placeholder="选择开始时间"
                                                                @change="startTime($event,scope)"></el-date-picker>
                                            </el-form-item>
                                        </el-form>
                                    </template>
                                </el-table-column>

Write the method scope. $index in methods ; it is currently the number of the array

Guess you like

Origin blog.csdn.net/ke_new/article/details/102714813