修复6155电量同步显示问题
This commit is contained in:
@ -574,12 +574,21 @@
|
||||
if (!json) {
|
||||
return;
|
||||
}
|
||||
console.log("收到设备数据:", json);
|
||||
let keys = Object.keys(json);
|
||||
keys.forEach((key) => {
|
||||
if (key in these.formData) {
|
||||
these.formData[key] = json[key];
|
||||
// 确保响应式更新
|
||||
console.log(`更新字段 ${key}: ${these.formData[key]} -> ${json[key]}`);
|
||||
these.$set(these.formData, key, json[key]);
|
||||
} else {
|
||||
console.log(`字段 ${key} 不在 formData 中,跳过更新`);
|
||||
}
|
||||
});
|
||||
|
||||
// 强制触发视图更新,确保电量显示同步
|
||||
these.$forceUpdate();
|
||||
console.log("更新后的电量:", these.formData.battary);
|
||||
|
||||
if (this.formData.battary <= 20) {
|
||||
this.showPop({
|
||||
|
||||
Reference in New Issue
Block a user