let hasObj = false;
for (let i in data.imgPathInfo){
hasObj = true;
break;
}
if(!hasObj){
_this.$message.error('图片路径对象为空!');
}
获取number类型数字长度:n.toString().length
jq
function isEmptyObject(e) {
var t;
for (t in e)
return !1;
return !0
}
console.log($.isEmptyObject({"re": 2})); //false
console.log(isEmptyObject()); //true
console.log(isEmptyObject({})); //true
console.log(isEmptyObject(null)); //true
console.log(isEmptyObject(23)); //true
console.log(isEmptyObject({"te": 2})); //false
相关文章:http://blog.csdn.net/testcs_dn/article/details/40431835