vue3.0打包后打开dist中的index.html报下列错误
百度了好久还是解决不了问题
Ebook.vue中代码:
const DOWNLOAD_URL = '/book.epub' global.ePub = Epub export default { methods: { // 根据链接跳转到指定目录 jumpTo (href) { this.rendition.display(href) this.menuToggle() }, // progress值为0-100 onProgressChange (progress) { const precentage = progress / 100 const location = precentage > 0 ? this.location.cfiFromPercentage(precentage) : 0 this.rendition.display(location) }, // 电子书解析和渲染 showEpub () { // 生成Ebook this.book = new Epub(DOWNLOAD_URL) // 生成Rendition,通过Book.renderTo方法生成 this.rendition = this.book.renderTo('read', { width: window.innerWidth, height: window.innerHeight }) // 通过Rendition.display渲染电子书 this.rendition.display() this.themes = this.rendition.themes this.changeFontSize(this.defaultFontSize) this.registerTheme() this.setTheme(this.defaultTheme) // 获取location对象来实现阅读进度功能 this.book.ready.then(() => { this.navigation = this.book.navigation // console.log(all) // console.log(this.navigation) return this.book.locations.generate() }).then(result => { this.location = this.book.locations this.bookAvailable = true }) }
vue.config.js中代码:
const path = require('path') function resolve (dir) { return path.join(__dirname, dir) } module.exports = { chainWebpack: (config) => { config.resolve.alias .set('src', resolve('src')) .set('styles', resolve('src/assets/styles')) .set('components', resolve('src/components')) }, devServer: { host: '0.0.0.0', port: 8080 }, publicPath: './' }
不知道哪里出了问题,求救!!!