this.book.ready.then(()=>{
return this.book.locations.generate();
}).then(result=>{
console.log(result)
});
看this.book.locations的结果是生成好了,但是没有走到result你好,从源码看没什么问题,可以考虑book对象解析是否出了问题,或者其他错误导致this.book.ready没有触发成功
我一开始也是遇到跟你一样的问题,result打印不出来结果,后来打印我才注意到,因为我用的是在网上找的电子小说素材
Promise {[[PromiseStatus]]: "pending", [[PromiseValue]]: undefined}
__proto__
:
Promise
[[PromiseStatus]]
:
"pending"
[[PromiseValue]]
:
undefined他这里的状态是pending,你需要等待一段时间(我猜根据你电子书的大小吧),过一会就能打印出来result
可能是我找的epub源的问题,换成提供的素材就没有问题了