Element-ui如何在多层table中校验el-date-picker控件的开始时间结束时间并传值

此处遇到多层table之间校验时间的大小问题,将时间控件加上onchange事件。加入$event才能传值,然后scope是当前的一层table的所有值。简单明了,不明白的控制台console.log(scope)一下。

<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>

methods里面写方法 scope.$index;为当前是数组的第几个

猜你喜欢

转载自blog.csdn.net/ke_new/article/details/102714813
今日推荐