| | |
| | | loadThreshold: 300, // 触发加载阈值 |
| | | throttleThreshold: 100, // 节流阈值 |
| | | previousScrollTop: 0, |
| | | throttledScrollHandler: null |
| | | throttledScrollHandler: null, |
| | | }; |
| | | }, |
| | | watch: { |
| | | showCatalogList: { |
| | | handler(newVal) { |
| | | console.log("显示章节", newVal); |
| | | this.$store.state.qiankun.windowSelection({ |
| | | showCatalogList: newVal, |
| | | }); |
| | | }, |
| | | }, |
| | | }, |
| | | mounted() { |
| | | // 默认加载章节 |
| | |
| | | }, |
| | | methods: { |
| | | scrollFun(e) { |
| | | |
| | | // 判断向上滚动还是向下滚动 |
| | | if (event.target.scrollTop > this.previousScrollTop) { |
| | | console.log("向下滚动"); |
| | |
| | | } |
| | | } |
| | | } |
| | | // showCatalogList 当前显示的三个章节,watch监听传递给主应用 |
| | | console.log(this.showCatalogList); |
| | | // 更新上一次滚动的位置 |
| | | this.previousScrollTop = event.target.scrollTop; |
| | | } |
| | | }, |
| | | }, |
| | | components: { |
| | | pageHeader, |
| | |
| | | chapterTen, |
| | | chapterEleven, |
| | | chapterTwelve, |
| | | chapterThirteen |
| | | } |
| | | chapterThirteen, |
| | | }, |
| | | }; |
| | | </script> |
| | | |