From c3a97e9da90ab1a34f766acd35944d295cc5a6bf Mon Sep 17 00:00:00 2001 From: unknown <qq1940665526@163.com> Date: 星期三, 05 六月 2024 13:41:00 +0800 Subject: [PATCH] 优化 --- src/books/childHealth/view/content/components/chapter010.vue | 26 ++++++++++++++++---------- 1 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/books/childHealth/view/content/components/chapter010.vue b/src/books/childHealth/view/content/components/chapter010.vue index 2715bc8..64cc7d2 100644 --- a/src/books/childHealth/view/content/components/chapter010.vue +++ b/src/books/childHealth/view/content/components/chapter010.vue @@ -1364,6 +1364,10 @@ showPageList: { type: Array, }, + isSearch: { + type: Boolean, + default: false, + }, }, data() { return { @@ -1426,17 +1430,19 @@ }; }, async mounted() { - const localData = localStorage.getItem("chapterTenData"); - if (localData) { - this.chapterTenData = JSON.parse(localData); - } - window.timerTen = setInterval(() => { - this.saveTime--; - if (this.saveTime == 0) { - this.saveChapterOneData(); + if(!this.isSearch) { + const localData = localStorage.getItem("chapterTenData"); + if (localData) { + this.chapterTenData = JSON.parse(localData); } - }, 1000); - this.getVideoPath(); + window.timerTen = setInterval(() => { + this.saveTime--; + if (this.saveTime == 0) { + this.saveChapterOneData(); + } + }, 1000); + this.getVideoPath(); + } }, unmounted() { if (window.timerTen) { -- Gitblit v1.9.1