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/chapter002.vue | 18 ++++++++++++------ 1 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/books/childHealth/view/content/components/chapter002.vue b/src/books/childHealth/view/content/components/chapter002.vue index f6b60f2..49a8582 100644 --- a/src/books/childHealth/view/content/components/chapter002.vue +++ b/src/books/childHealth/view/content/components/chapter002.vue @@ -1326,7 +1326,7 @@ <script> import examinations from "@/components/examinations/index.vue"; -import getResourcePath from "@/assets/methods/resources"; +import {getResourcePath} from "@/assets/methods/resources"; export default { name: "chapterTwo", components: { examinations }, @@ -1336,6 +1336,10 @@ }, showPageList:{ type:Array + }, + isSearch:{ + type:Boolean, + default:false } }, data() { @@ -1426,7 +1430,8 @@ }; }, async mounted() { - const localData = localStorage.getItem("chapterTwoData"); + if(!this.isSearch) { + const localData = localStorage.getItem("chapterTwoData"); if (localData) { this.chapterTwoData = JSON.parse(localData); } @@ -1437,6 +1442,7 @@ } }, 1000); this.getVideoPath(); + } }, unmounted() { if (window.timerTwo) { @@ -1457,10 +1463,10 @@ this.$data.videoState = !this.$data.videoState; } }, - getVideoPath() { - this.$data.pathOne = getResourcePath("e2b2b610e8b77c82bad7cf94c7986646"); - this.$data.pathTwo = getResourcePath("b11b51863da2a4e7e21c73358fa96c1e"); - this.$data.pathThree = getResourcePath( + async getVideoPath() { + this.$data.pathOne = await getResourcePath("e2b2b610e8b77c82bad7cf94c7986646"); + this.$data.pathTwo = await getResourcePath("b11b51863da2a4e7e21c73358fa96c1e"); + this.$data.pathThree = await getResourcePath( "67cf97bd8295dc3aeb46982c574df8d0" ); }, -- Gitblit v1.9.1