闫增涛
2024-05-20 e5ac9c38a59646544e6d4b6dee0b3c5f2970118f
src/books/childHealth/view/content/index.vue
@@ -1,7 +1,8 @@
<template>
  <div class="page-main" @scroll="throttledScrollHandler">
    <div class="page-content" :style="{fontSize: fontSize ? fontSize + 'px' : '16px',
  transform: `scale(${pageZoom ? pageZoom : 1})`}">
    <div
      class="page-content"
    >
      <pageHeader v-if="showCatalogList.indexOf(0) > -1"></pageHeader>
      <chapterOne v-if="showCatalogList.indexOf(1) > -1"></chapterOne>
      <chapterTwo v-if="showCatalogList.indexOf(2) > -1"></chapterTwo>
@@ -50,14 +51,6 @@
      throttledScrollHandler: null,
      observer: null
    };
  },
  computed:{
    fontSize() {
      return this.$store.state.qiankun.fontSize
    },
    pageZoom() {
      return this.$store.state.qiankun.scale / 100
    }
  },
  watch: {
    showCatalogList: {
@@ -277,7 +270,9 @@
      }
    },
    initObservation() {
      const sections = document.querySelectorAll(".page-box");
      const sections = (
        this.container ? this.container : document
      ).querySelectorAll(".page-box");
      //observer 观察每个元素,以便在它们进入或离开视窗时触发回调函数。
      sections.forEach((section) => {
        const isObserver = section.getAttribute("observer");