vue快速搭建web阅读器(六)进度条设置
1.在父组件中通过epubjs中的locations对象实现
// 获取Locations对象(实现阅读进度功能)
// 通过epubjs的钩子函数来实现
this.book.ready.then(() => {
return this.book.locations.generate()
}).then(result => {
this.locations = this.book.locations
this.onProgressChange(50)
})
2.将信息传递给子组件