JSON.parse (JSON.stringify (item))
this kind of thing, copy an object, as a result, the 0 and 1 in item are automatically lengthened false and true
how to avoid?
the following example:
console.log("origin", item);
self.devTypeObj = JSON.parse(JSON.stringify(item))
console.log("json", JSON.stringify(item));
console.log("result", self.devTypeObj);
JSON.parse 0 1 boolean
data:
{
"id": 75,
"brand": "",
"model": "ZR250VSD",
"prol": "GeneralModbusRTU",
"readInterval": 1,
"useType": "",
"iconUrl": null,
"iotCollItems": [{
"id": 158,
"dataLen": 2,
"isGet": 1,
"name": "",
"dataType": "short/10",
"propertyType": 100,
"unit": "",
"valueAddr": 19,
"valueAddrStr": "0",
"warnDown": 0,
"warnUp": 0
}, {
"id": 159,
"dataLen": 2,
"isGet": 1,
"name": "",
"dataType": "short/10",
"propertyType": 100,
"unit": "",
"valueAddr": 19,
"valueAddrStr": "0",
"warnDown": 0,
"warnUp": 0
}]
}