判断某个字符是否为空(常用方法)
// 判断某个字符是否为空 isEmpty(obj){
if(obj == 0) obj = obj.toString(); if(typeof obj == "undefined" || obj == null || obj == "" || obj.length == 0){ return obj; }else{ return false; } },
更新:
export default{ isEmpty:(obj)=>{ if (obj == 0) obj = obj.toString(); if ( typeof obj == "undefined" || obj == null || obj == "" || obj.length == 0 || Object.keys(obj).length == 0 ) { return true; } else { return false; } }, }