beforeOpen(done, type) {
if (["add"].includes(type)) {
this.form.released = 'N';
this.form.opened = 'Y';
this.form.releaseBy = "办公室";
}else if (["edit", "view"].includes(type)) {
getNotice(this.form.id).then(res => {
this.form = res.data.data;
});
}
done();
},
但在第一次点新增打开表单录入界面时,初值未能显示,
解决方案:
一、用settimeout包起来赋值的部分;(官方推荐)
二、this.form={releaseBy=:‘办公室’}