//封装为一个方法判断变量是否为空 isobjEmpty(obj) { if (obj === null || obj === undefined || obj === "" || obj.length === 0 || obj === {}) { return true; } else { return false; } }, //使用 if(!this.isobjEmpty(obj)){ //存在 }else{ //不存在 }
//封装为一个方法判断变量是否为空 isobjEmpty(obj) { if (obj === null || obj === undefined || obj === "" || obj.length === 0 || obj === {}) { return true; } else { return false; } }, //使用 if(!this.isobjEmpty(obj)){ //存在 }else{ //不存在 }
Powered By Z-BlogPHP 1.7.3
Copyright iXiaoBai.net Rights Reserved. 吉ICP备18001369号-1 吉公网安备22010202001107