unknown
2024-05-28 2c85d49d5e4fb5ed4454cdaf06143ed0d9d131b7
src/books/lifeCare/index.vue
@@ -1,3 +1,4 @@
<!-- eslint-disable vue/multi-word-component-names -->
<template>
  <div class="page-main" @scroll="throttledScrollHandler">
    <div
@@ -8,6 +9,7 @@
        transform: `scale(${pageZoom ? pageZoom : 1})`,
      }"
    >
      <drawflow />
      <front001 v-if="showCatalogList.indexOf(1) > -1" />
      <ChapterOne v-if="showCatalogList.indexOf(2) > -1" />
      <ChapterTwo v-if="showCatalogList.indexOf(3) > -1" />
@@ -68,6 +70,7 @@
  },
  watch: {
    showCatalogList: {
      // eslint-disable-next-line no-unused-vars
      handler(newVal, oldVal) {
        if (
          this.$store.state.qiankun &&
@@ -89,7 +92,7 @@
  },
  mounted() {
    // 默认加载章节
    this.showCatalogList = [5];
    this.showCatalogList = [0];
    // 滚动监听节流
    this.throttledScrollHandler = _.throttle(
      this.scrollFun,
@@ -192,6 +195,7 @@
      ).getSelection();
      const txt = selection.toString();
      if (selection.type != "none" && txt) {
        // eslint-disable-next-line no-unused-vars
        let node = selection.anchorNode.parentNode;
        let pageHtml = this.getParentWithClass(
          selection.anchorNode,
@@ -461,6 +465,7 @@
        }
      });
    },
    // eslint-disable-next-line
    getParentWithClass(element, className) {
      while (element.parentElement) {
        element = element.parentElement;
@@ -469,6 +474,7 @@
        }
      }
    },
    // eslint-disable-next-line no-unused-vars
    pageChangeCallback(entries, observer) {
      //entries:代表观察到的目标元素的集合。 observer:代表观察者对象。
      entries.forEach((entry) => {
@@ -495,7 +501,7 @@
        }
      });
    },
  },
  }
};
</script>