var deferred = new Deferred();var index = 0; results.forEach(function( item ){ //results是数组 index ++; if( index === results.length - 1 ){ deferred.resolve(index); }}); deferred.then(function(last){if( last ){button.hidden = false;}els
var deferred = new Deferred(); var index = 0; results.forEach(function( item ){ //results是数组 index ++; if( index === results.length - 1 ){ deferred.resolve(index); } }); deferred.then(function(last){ if( last ){ button.hidden = false; }else{ button.hidden = true; } });