From 5d3124519a3e130f2ca7517aee025eb112bdb611 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=81=8C=E7=B3=96=E5=8C=85=E5=AD=90?= Date: Wed, 18 Jan 2023 19:59:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4aplayer=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E9=83=A8=E5=88=86=E5=BA=9F=E5=BC=83=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/api/Music.vue | 2 +- .../api/aplayer/components/aplayer-list.vue | 4 +- src/views/api/aplayer/utils.js | 4 - src/views/api/aplayer/vue-aplayer.vue | 96 +++---------------- 4 files changed, 14 insertions(+), 92 deletions(-) diff --git a/src/views/api/Music.vue b/src/views/api/Music.vue index 3066b2f..dd023ad 100644 --- a/src/views/api/Music.vue +++ b/src/views/api/Music.vue @@ -225,7 +225,7 @@ export default class Music extends BaseList { pic: `/api/v2/common/music/album/${item._id}`, } if(item.lyric_id) { - musicItem.lrc = `${location.origin}/api/v1/common/music/lyric/${item.lyric_id}` + musicItem.lrc = `${location.origin}/api/v2/common/music/lyric/${item.lyric_id}` } return musicItem }) diff --git a/src/views/api/aplayer/components/aplayer-list.vue b/src/views/api/aplayer/components/aplayer-list.vue index bdeaccd..8c395ab 100644 --- a/src/views/api/aplayer/components/aplayer-list.vue +++ b/src/views/api/aplayer/components/aplayer-list.vue @@ -45,13 +45,13 @@ default: 0, }, theme: String, - listmaxheight: String, + listMaxHeight: String, }, computed: { listHeightStyle () { return { height: `${33 * this.musicList.length - 1}px`, - maxHeight: this.listmaxheight || '' + maxHeight: this.listMaxHeight || '' } } } diff --git a/src/views/api/aplayer/utils.js b/src/views/api/aplayer/utils.js index 41e036c..0256a0b 100644 --- a/src/views/api/aplayer/utils.js +++ b/src/views/api/aplayer/utils.js @@ -50,10 +50,6 @@ export function warn (message) { return console.warn(`[Vue-APlayer] ${message}`) } -export function deprecatedProp (name, sinceVersion, alternative) { - return warn(`'${name}' is deprecated since v${sinceVersion}, and will be removed in future releases, use '${alternative}' instead`) -} - export function getElementViewLeft (element) { let actualLeft = element.offsetLeft let current = element.offsetParent diff --git a/src/views/api/aplayer/vue-aplayer.vue b/src/views/api/aplayer/vue-aplayer.vue index a038327..b99a999 100644 --- a/src/views/api/aplayer/vue-aplayer.vue +++ b/src/views/api/aplayer/vue-aplayer.vue @@ -2,9 +2,9 @@
-
+
{{ currentMusic.title || 'Untitled' }} {{ currentMusic.artist || currentMusic.author || 'Unknown' }}
- + @@ -63,7 +63,7 @@ import MusicList from './components/aplayer-list.vue' import Controls from './components/aplayer-controller.vue' import Lyrics from './components/aplayer-lrc.vue' - import { deprecatedProp, warn } from './utils' + import { warn } from './utils' /** * memorize self-adapting theme for cover image urls @@ -98,13 +98,7 @@ type: Object, required: true, validator (song) { - if (song.url) { - deprecatedProp('music.url', '1.4.0', 'music.src') - } - if (song.author) { - deprecatedProp('music.author', '1.4.1', 'music.artist') - } - return song.src || song.url + return song.src }, }, list: { @@ -220,62 +214,7 @@ repeat: { type: String, default: REPEAT.NO_REPEAT, - }, - - - // deprecated props - - /** - * @deprecated since 1.1.2, use listMaxHeight instead - */ - listmaxheight: { - type: String, - validator (value) { - if (value) { - deprecatedProp('listmaxheight', '1.1.2', 'listMaxHeight') - } - return true - }, - }, - /** - * @deprecated since 1.1.2, use mini instead - */ - narrow: { - type: Boolean, - default: false, - validator (value) { - if (value) { - deprecatedProp('narrow', '1.1.2', 'mini') - } - return true - }, - }, - /** - * @deprecated since 1.2.2 - */ - showlrc: { - type: Boolean, - default: false, - validator (value) { - if (value) { - deprecatedProp('showlrc', '1.2.2', 'showLrc') - } - return true - }, - }, - /** - * @deprecated and REMOVED since 1.5.0 - */ - // mode: { - // type: String, - // default: 'circulation', - // validator (value) { - // if (value) { - // deprecatedProp('mode', '1.5.0', 'shuffle and repeat') - // } - // return true - // } - // }, + } }, data () { return { @@ -343,14 +282,6 @@ this.internalMusic = val }, }, - // compatible for deprecated props - isMiniMode () { - return this.mini || this.narrow - }, - shouldShowLrc () { - return this.showLrc || this.showlrc - }, - // props wrappers currentTheme () { @@ -368,8 +299,7 @@ }, shouldShowNativeControls () { return process.env.NODE_ENV !== 'production' && - this.controls && - !this.isMiniMode + this.controls && !this.mini }, // useful @@ -491,10 +421,6 @@ }) }, - // controls - - // play/pause - toggle () { if (!this.audio.paused) { this.pause()