epubcfi: c---f----i--->
canonical fragment identifiers(规范片段标识符)
读书进度条 bockground-size 设置,
按钮 由轨道设置而来
// 初始化 epubjs 的 location 对象 this.book.ready.then(() => { return this.book.loacations.generate() }).then(res => { console.log(res) this.locations = this.book.loacations }) // 生成 epubjs 的 location 的 方法 this.locations.cfiFromPercentage(percentage)
locations对象有cfiFromPercentage方法,将百分比传入该方法生成location
this.book.locations.cfiFromPercentage(percentage)
this.book.ready表示电子书解析完成后调用的方法,返回一个Promise
this.book.ready.then(()=>{
return this.book.locations.generate()
}).then((result)=>{
console.log(result)
})
获取locations对象
this.book.locations