问题描述:在某个回调事件中,给表单中的某个input赋值(已绑定v-model),input不显示数据且无法编辑,在这个表单的其他input中修改值时,这个被赋值的input才会回显。
解决办法:在回调事件函数中,给input赋值后,强制刷新:this.$forceUpdate();
this.$http.post("/rentRecord/getRechargeStandard", params).then((res) => {
if (res.status === 0) {
console.log(JSON.stringify(res.data));
this.formData.endTime = res.data.endTime;
this.formData.rechargeMoney = res.data.rechargeMoney;
this.$forceUpdate();
console.log("金额" + this.formData.rechargeMoney);
} else {
this.$message({
message: res.msg,
type: "warning",
});
}
});