今天在完成项目的某个模块的修改业务时,数据没有回显在表单里
js文件
const defaultForm = {
processNo: '',
name: '',
reasons: '',
overtimeStart: '',
overtimeEnd: '',
projectHours: '',
projectNo: ''
}
export default {
data() {
return {
list: [], //加班信息列表
page: 1,
limit: 30,
total: 0, //总记录数
searchObj: {}, //封装对象
otOvertime: {},
dialogVisible: false,
otOvertime: defaultForm,
saveBtnDisabled: false
};
},
删除 otOvertime: defaultForm,
.vue
methods: {
edit(id) {
this.dialogVisible = true;
otl.getOvertimeInfo(id).then((response) => {
this.otOvertime = response.data.otOvertime;
console.log(this.otOvertime)
});
},
可以在控制台查看参数名
response.data添加.otOvertime
成功回显
标签:Vue,回显,defaultForm,表单,otOvertime,data,response From: https://www.cnblogs.com/fancy2022/p/16846389.html