diff --git a/src/views/index.vue b/src/views/index.vue index 66a11ca..80386c6 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -118,6 +118,9 @@ export default { // 根基重量值是否低于阈值,设置报警器、加热器的状态 this.value2 = false; + // 转为数字类型判断 + this.deviceInfo.weight = Number(this.deviceInfo.weight); + this.deviceInfo.threshold = Number(this.deviceInfo.threshold); if (this.deviceInfo.weight < this.deviceInfo.threshold) { this.value2 = true; }