为什么我的epub渲染时候会报错误
来源:4-2 阅读器解析和渲染
deriven
2020-08-20
Uncaught TypeError: this.ViewManager is not a constructor
3回答
-
同学你好,可以把代码上传一下吗。这边我在本地帮你定位一下,
012020-08-27 -
deriven
提问者
2020-08-21
我是按照老师教程走的,url没有问题,点击能够下载
00 -
deriven
提问者
2020-08-21
<template>
<div class="ebook-reader">
<div id="read"></div>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import Epub from 'epubjs'
export default {
computed: {
...mapGetters(['fileName'])
},
methods: {
initEpub () {
const url = 'http://192.168.18.41:8080/epub/' + this.fileName + '.epub'
// console.log(url)
this.book = new Epub(url)
console.log(this.book)
this.rendition = this.book.renderTo('read', {
width: innerWidth,
height: innerHeight,
methods: 'default'
})
this.rendition.display()
}
},
mounted () {
const fileName = this.$route.params.fileName.split('|').join('/')
this.$store.dispatch('setFileName', fileName).then(() => {
this.initEpub()
})
}
}
</script>
022020-08-22
相似问题
回答 1
回答 1