YM
2024-05-17 43025a4e8d19deb402fae4b537f6c3f99d5c9b8e
src/books/childHealth/view/content/index.vue
@@ -1,7 +1,12 @@
<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"
      :style="{
        fontSize: fontSize ? fontSize + 'px' : '16px',
        transform: `scale(${pageZoom ? pageZoom : 1})`
      }"
    >
      <pageHeader v-if="showCatalogList.indexOf(0) > -1"></pageHeader>
      <chapterOne v-if="showCatalogList.indexOf(1) > -1"></chapterOne>
      <chapterTwo v-if="showCatalogList.indexOf(2) > -1"></chapterTwo>
@@ -51,12 +56,12 @@
      observer: null
    };
  },
  computed:{
  computed: {
    fontSize() {
      return this.$store.state.qiankun.fontSize
      return this.$store.state.qiankun.fontSize;
    },
    pageZoom() {
      return this.$store.state.qiankun.scale / 100
      return this.$store.state.qiankun.scale / 100;
    }
  },
  watch: {
@@ -277,7 +282,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");