| | |
| | | v-if="showCatalogList.indexOf(2) > -1" |
| | | :showPageList="loadPageList" |
| | | ></chapterOne> |
| | | <chapterTwo |
| | | v-if="showCatalogList.indexOf(3) > -1" |
| | | :showPageList="loadPageList" |
| | | > |
| | | </chapterTwo> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | <script> |
| | | import pageHeader from "./header.vue"; |
| | | import chapterOne from "./chapter001.vue"; |
| | | import chapterTwo from "./chapter002.vue"; |
| | | import NoteIcon from "@/assets/images/biji.png"; |
| | | import _ from "lodash"; |
| | | import Swiper from "swiper/bundle"; |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | catalogLength: 2, // 总章节数 |
| | | catalogLength: 3, // 总章节数 |
| | | showCatalogList: [], // 显示的章节 |
| | | loadThreshold: 300, // 触发加载阈值 |
| | | throttleThreshold: 100, // 节流阈值 |
| | |
| | | init:(value) => { |
| | | let currentPage = value.activeIndex + 1; // 获取当前页(从1开始计数) |
| | | let totalPages = value.slides.length; // 获取总页数 |
| | | var paginationInfoEl = dom.querySelector('.pageBox'); |
| | | var paginationInfoEl = dom.querySelector(".pageBox"); |
| | | if(paginationInfoEl) |
| | | paginationInfoEl.textContent = currentPage + '/' + totalPages; |
| | | paginationInfoEl.textContent = currentPage + "/" + totalPages; |
| | | }, |
| | | slideChange:(value) => { |
| | | let currentPage = value.activeIndex + 1; // 获取当前页(从1开始计数) |
| | | let totalPages = value.slides.length; // 获取总页数 |
| | | var paginationInfoEl = dom.querySelector('.pageBox'); |
| | | var paginationInfoEl = dom.querySelector(".pageBox"); |
| | | if(paginationInfoEl) |
| | | paginationInfoEl.textContent = currentPage + '/' + totalPages; |
| | | paginationInfoEl.textContent = currentPage + "/" + totalPages; |
| | | }, |
| | | }, |
| | | }); |
| | |
| | | components: { |
| | | pageHeader, |
| | | chapterOne, |
| | | chapterTwo, |
| | | }, |
| | | }; |
| | | </script> |