From baf0ae1b0419def1d89ffa2930c09b71bdd86ed7 Mon Sep 17 00:00:00 2001 From: A1300399510 <A1300399510> Date: Tue, 23 Jul 2024 10:53:10 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=89=E4=B8=AD=E7=BA=AF=E9=9F=B3=E4=B9=90?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=AD=8C=E8=AF=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/App.vue b/src/App.vue index 11fd669..d456d40 100644 --- a/src/App.vue +++ b/src/App.vue @@ -496,6 +496,14 @@ const handlelike = index => { // target.is_liked = 1 } + +// 切换纯音乐 +const switchchange = value => { + // 当切换到纯音乐时去掉歌词 + if (!value) { + obj.value.prompt = "" + } +} </script> <template> @@ -561,7 +569,7 @@ const handlelike = index => { <template v-else> <div class="toggle-switch title-box flexacenter"> <div class="title-left flexacenter"> - <el-switch v-model="obj.has_vocal" style="--el-switch-on-color: #fbd38d; --el-switch-off-color: #ffffff3d;" :active-value="false" :inactive-value="true" /> + <el-switch v-model="obj.has_vocal" style="--el-switch-on-color: #fbd38d; --el-switch-off-color: #ffffff3d;" :active-value="false" :inactive-value="true" @change="switchchange" /> 纯音乐 <el-popover placement="right" :width="150" trigger="click" content="没有歌词的音乐。"> <template #reference> @@ -571,7 +579,7 @@ const handlelike = index => { </div> </div> - <div class="lyric"> + <div class="lyric" v-if="obj.has_vocal"> <div class="title-box flexacenter"> <div class="title-left flexacenter"> 歌词