element日期控件修改时候显示1970年的问题
记录下element日期控件修改时候显示1970年的问题,新增时候正常。
因为DatePicker 日期选择器不支持字符串,只支持时间格式
//修改 openEditDia(data) { let yearDate = new Date(); yearDate.setYear(data.year); this.addQuery.id = data.id, this.addQuery.year = yearDate, //把年份处理下再赋给绑定的年份 this.addQuery.orgName = data.orgName, this.addQuery.orgId = data.orgId; this.addQuery.dockingPeople = data.dockingPeople this.addQuery.dockingPeopleName = data.dockingPeopleName, this.addQuery.conference = data.conference, this.addQuery.participant = data.participant, this.addQuery.organization = data.organization, this.addQuery.contac = data.contac, this.addQuery.remark = data.remark, this.dialogTitle = '《高端对接清单》' this.addDialogVisible = true this.editFlag = true; console.log(this.addQuery.year, '年份') this.jsId = data.orgId; this.getPerson() },