| | |
| | | }"> |
| | | <pageHeader v-if="showCatalogList.indexOf(1) > -1" :showPageList="loadPageList"></pageHeader> |
| | | <chapterOne v-if="showCatalogList.indexOf(2) > -1" :showPageList="loadPageList"></chapterOne> |
| | | <!-- <chapterTwo v-if="showCatalogList.indexOf(3) > -1" :showPageList="loadPageList"></chapterTwo> |
| | | <chapterTwo v-if="showCatalogList.indexOf(3) > -1" :showPageList="loadPageList"></chapterTwo> |
| | | <chapterThree v-if="showCatalogList.indexOf(4) > -1" :showPageList="loadPageList"></chapterThree> |
| | | <chapterFour v-if="showCatalogList.indexOf(5) > -1" :showPageList="loadPageList"></chapterFour> |
| | | <chapterFive v-if="showCatalogList.indexOf(6) > -1" :showPageList="loadPageList"></chapterFive> |
| | | <chapterSix v-if="showCatalogList.indexOf(7) > -1" :showPageList="loadPageList"></chapterSix> |
| | | <chapterSeven v-if="showCatalogList.indexOf(8) > -1" :showPageList="loadPageList"></chapterSeven> |
| | | <chapterEight v-if="showCatalogList.indexOf(9) > -1" :showPageList="loadPageList"></chapterEight> --> |
| | | <chapterEight v-if="showCatalogList.indexOf(9) > -1" :showPageList="loadPageList"></chapterEight> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | <script> |
| | | import pageHeader from "./header.vue"; |
| | | import chapterOne from "./chapter001.vue"; |
| | | // import chapterTwo from "./chapter002.vue"; |
| | | // import chapterThree from "./chapter003.vue"; |
| | | // import chapterFour from "./chapter004.vue"; |
| | | // import chapterFive from "./chapter005.vue"; |
| | | // import chapterSix from "./chapter006.vue"; |
| | | // import chapterSeven from "./chapter007.vue"; |
| | | // import chapterEight from "./chapter008.vue"; |
| | | import chapterTwo from "./chapter002.vue"; |
| | | import chapterThree from "./chapter003.vue"; |
| | | import chapterFour from "./chapter004.vue"; |
| | | import chapterFive from "./chapter005.vue"; |
| | | import chapterSix from "./chapter006.vue"; |
| | | import chapterSeven from "./chapter007.vue"; |
| | | import chapterEight from "./chapter008.vue"; |
| | | import NoteIcon from "@/assets/images/biji.png"; |
| | | import _ from "lodash"; |
| | | import Swiper from "swiper/bundle"; |
| | |
| | | name: "pageContent", |
| | | data() { |
| | | return { |
| | | catalogLength: 2, // 总章节数 |
| | | catalogLength: 9, // 总章节数 |
| | | showCatalogList: [], // 显示的章节 |
| | | loadThreshold: 300, // 触发加载阈值 |
| | | throttleThreshold: 100, // 节流阈值 |
| | |
| | | // 默认加载章节 |
| | | this.showCatalogList = [1]; |
| | | // 滚动监听节流 |
| | | debugger |
| | | this.throttledScrollHandler = _.throttle( |
| | | this.scrollFun, |
| | | this.throttleThreshold, |
| | |
| | | }, 500); |
| | | |
| | | // 测试页面跳转 |
| | | // setTimeout(() => { |
| | | // this.gotoPage(2,8); |
| | | setTimeout(() => { |
| | | this.gotoPage(1,1); |
| | | // setTimeout(() => { |
| | | // this.renderSign("Highlight", { |
| | | // id: "2ACA9359", |
| | |
| | | // ids: ["2ACA9359"] |
| | | // }); |
| | | // }, 2000); |
| | | // }, 500); |
| | | }, 500); |
| | | |
| | | // const pageDom = (this.container ? this.container : document) |
| | | // .querySelector("#app") |
| | |
| | | ) { |
| | | console.log(1); |
| | | |
| | | debugger |
| | | // 到达阈值 |
| | | if ( |
| | | this.showCatalogList[this.showCatalogList.length - 1] < |
| | |
| | | const pageData = { |
| | | pageHeader, |
| | | chapterOne, |
| | | // chapterTwo, |
| | | // chapterThree, |
| | | // chapterFour, |
| | | // chapterFive, |
| | | // chapterSix, |
| | | // chapterSeven, |
| | | // chapterEight |
| | | chapterTwo, |
| | | chapterThree, |
| | | chapterFour, |
| | | chapterFive, |
| | | chapterSix, |
| | | chapterSeven, |
| | | chapterEight |
| | | }; |
| | | // 遍历所有章节文件 |
| | | for (const key in pageData) { |
| | |
| | | components: { |
| | | pageHeader, |
| | | chapterOne, |
| | | // chapterTwo, |
| | | // chapterThree, |
| | | // chapterFour, |
| | | // chapterFive, |
| | | // chapterSix, |
| | | // chapterSeven, |
| | | // chapterEight |
| | | chapterTwo, |
| | | chapterThree, |
| | | chapterFour, |
| | | chapterFive, |
| | | chapterSix, |
| | | chapterSeven, |
| | | chapterEight |
| | | }, |
| | | }; |
| | | </script> |