課程
/前端開發(fā)
/Vue.js
/快速入門Web閱讀器開發(fā)
跟著你一起操作,但是我自己下了個epub電子書, 放static里,為何沒顯示封面的效果,,
2018-09-12
源自:快速入門Web閱讀器開發(fā) 2-2
正在回答
你好,這個現(xiàn)象比較抽象,能否提供一下源碼,看下你的實現(xiàn)過程
qq_嶸歸_0 提問者
Sam 回復 qq_嶸歸_0 提問者
qq_嶸歸_0 提問者 回復 Sam
照著你的代碼寫的,提示如圖錯誤
<template>
? <div class="ebook">
? ? <div class="read-wrapper">
? ? ? <div id="read"></div>
? ? ? <div class="mask">
? ? ? ? <div class="left"></div>
? ? ? ? <div class="center"></div>
? ? ? ? <div class="right"></div>
? ? ? </div>
? ? </div>
? </div>
</template>
<script>
?import Epub from 'epubjs'
?const urlm = '/static/富爸爸窮爸爸.epub'
?global.epub = Epub
?export default {
? ?methods: {
? ? ?showEpub () {
? ? ? ?this.book = new Epub(urlm)
? ? ? ?this.rendition = this.book.renderTo('read', {
? ? ? ? ?width: window.innerWidth,
? ? ? ? ?height: window.innerHeight
? ? ? ?})
? ? ? ?this.rendition.display()
? ? ?}
? ?},
? ?mounted () {
? ? ?this.showEpub()
? ?}
}
</script>
<style scoped>
?@import 'assets/styles/global';
?.ebook{
? ?position: relative;
? ?.read-wrapper{
? ? ?.mask{
? ? ? ?position: absolute;
? ? ? ?top: 0;
? ? ? ?left: 0;
? ? ? ?z-index: 100;
? ? ? ?display: flex;
? ? ? ?width: 100%;
? ? ? ?height: 100%;
? ? ? ?.left{
? ? ? ? ?flex: 0 0 px2rem(100);
? ? ? ? ?background: yellow;
? ? ? ? }
? ? ? ? .center{
? ? ? ? ? flex: 1;
? ? ? ? ? background: red;
? ? ? ? .right{
? ? ? ? ?background: orange;
? ?}??
?}
</style>
舉報
帶你了解電子書閱讀器的工作原理,通過Vue.js快速實現(xiàn)Web閱讀器
1 回答可以打印出,但是渲染的時候沒有效果。
1 回答谷歌開發(fā)者左右點擊沒有效果
1 回答大佬,你的px2rem有效果嗎?
1 回答頁面顯示不出來內(nèi)容,然后控制臺報docment.addEventListener沒有這個函數(shù)我敲代碼就沒有。
1 回答為什么在iphone5s中顯示不了電子書
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網(wǎng)安備11010802030151號
購課補貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動學習伙伴
掃描二維碼關注慕課網(wǎng)微信公眾號
2018-09-12
你好,這個現(xiàn)象比較抽象,能否提供一下源碼,看下你的實現(xiàn)過程
2018-09-12
照著你的代碼寫的,提示如圖錯誤
<template>
? <div class="ebook">
? ? <div class="read-wrapper">
? ? ? <div id="read"></div>
? ? ? <div class="mask">
? ? ? ? <div class="left"></div>
? ? ? ? <div class="center"></div>
? ? ? ? <div class="right"></div>
? ? ? </div>
? ? </div>
? </div>
</template>
<script>
?import Epub from 'epubjs'
?const urlm = '/static/富爸爸窮爸爸.epub'
?global.epub = Epub
?export default {
? ?methods: {
? ? ?showEpub () {
? ? ? ?this.book = new Epub(urlm)
? ? ? ?this.rendition = this.book.renderTo('read', {
? ? ? ? ?width: window.innerWidth,
? ? ? ? ?height: window.innerHeight
? ? ? ?})
? ? ? ?this.rendition.display()
? ? ?}
? ?},
? ?mounted () {
? ? ?this.showEpub()
? ?}
}
</script>
<style scoped>
?@import 'assets/styles/global';
?.ebook{
? ?position: relative;
? ?.read-wrapper{
? ? ?.mask{
? ? ? ?position: absolute;
? ? ? ?top: 0;
? ? ? ?left: 0;
? ? ? ?z-index: 100;
? ? ? ?display: flex;
? ? ? ?width: 100%;
? ? ? ?height: 100%;
? ? ? ?.left{
? ? ? ? ?flex: 0 0 px2rem(100);
? ? ? ? ?background: yellow;
? ? ? ? }
? ? ? ? .center{
? ? ? ? ? flex: 1;
? ? ? ? ? background: red;
? ? ? ? }
? ? ? ? .right{
? ? ? ? ?flex: 0 0 px2rem(100);
? ? ? ? ?background: orange;
? ? ? ? }
? ? ?}
? ?}??
?}
</style>