var tmp = JSON.parse(obj)
var _this = this
try {
tmp.forEach(function (item, index) {
//跳出条件
if (item.state == 1) {
_this.setData({
jiachengNumber: item.jid
})
throw new Error("LoopTerminates");
}
});
} catch (e) {
// console.log(e)
if (e.message !== "LoopTerminates") throw e;
};
当循环的item中state 为1的时候 跳出循环