From ae287242c6580a9c34a541d717badbc4cce11e6e Mon Sep 17 00:00:00 2001 From: zonemeen Date: Tue, 12 Mar 2024 20:47:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=88=87=E6=8D=A2=E6=AD=8C=E6=9B=B2?= =?UTF-8?q?=E6=97=B6=E9=AB=98=E4=BA=AE=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/index.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/template/index.html b/template/index.html index 440ff7525..b10376051 100644 --- a/template/index.html +++ b/template/index.html @@ -109,13 +109,13 @@ player: null, controller: null, activeId: '', + isInitial: true, } }, beforeDestroy() { this.player.destroy() }, created() { - let isInitial = true this.controller = new AbortController() this.player = new APlayer({ container: document.getElementById('aplayer'), @@ -125,8 +125,8 @@ audio: [], }) this.player.on('listswitch', ({ index }) => { - if (isInitial) { - isInitial = false + if (this.isInitial) { + this.isInitial = false return } this.activeId = this.player.list.audios[index].id @@ -173,6 +173,7 @@ this.controller = new AbortController() } this.activeId = '' + this.isInitial = true this.downloadLoadingList = [] this.params.pageNum = current ?? 1 this.pagination.current = current ?? 1