fetch
是异步的。尝试
stores.fetch({
success:function() {
console.log(stores.toJSON());
}
});
要么
stores.on("sync", function() {
console.log(stores.toJSON());
});
stores.fetch();
要么
stores.fetch().then(function() {
console.log(stores.toJSON());
});