1、安装
nbpm install epubjs
2、.vue文件引入
import ePub from 'epubjs'
3、渲染
_this.book = ePub(o.request.response,null); _this.rendition = _this.book.renderTo(id, {width: window.innerWidth, height: window.innerHeight, manager: "continuous", flow: "scrolled"});//scrolled-doc _this.rendition.display();
注意:o.request.response返回的是arraybuffer,也可以是epub文件地址
.