From 8c17b70f3cbea830557b08ac2d29209061c837db Mon Sep 17 00:00:00 2001 From: qier222 Date: Sat, 31 Oct 2020 12:05:28 +0800 Subject: [PATCH] fix: some bugs --- src/App.vue | 1 + src/components/ArtistsInLine.vue | 25 ++++++++++++++-------- src/components/TrackList.vue | 12 ++++++++++- src/components/TrackListItem.vue | 8 ++++--- src/locale/lang/en.js | 4 ++-- src/locale/lang/zh-CN.js | 4 ++-- src/views/artist.vue | 36 +++++++++++++++++++++++--------- src/views/playlist.vue | 2 +- 8 files changed, 64 insertions(+), 28 deletions(-) diff --git a/src/App.vue b/src/App.vue index f177602..e3c1204 100644 --- a/src/App.vue +++ b/src/App.vue @@ -115,6 +115,7 @@ button { a { color: inherit; text-decoration: none; + cursor: pointer; &:hover { text-decoration: underline; } diff --git a/src/components/ArtistsInLine.vue b/src/components/ArtistsInLine.vue index 0d693f3..b834f47 100644 --- a/src/components/ArtistsInLine.vue +++ b/src/components/ArtistsInLine.vue @@ -1,8 +1,9 @@ @@ -15,16 +16,22 @@ export default { type: Array, required: true, }, - showFirstArtist: { - type: Boolean, - default: true, + exclude: { + type: String, + default: "", + }, + prefix: { + type: String, + default: "", }, }, computed: { - slicedArtists() { - return this.showFirstArtist - ? this.artists - : this.artists.slice(1, this.artists.length); + filteredArtists() { + return this.artists.filter((a) => a.name !== this.exclude); + }, + computedPrefix() { + if (this.filteredArtists.length !== 0) return this.prefix; + else return ""; }, }, }; diff --git a/src/components/TrackList.vue b/src/components/TrackList.vue index a783cf3..cfa56ae 100644 --- a/src/components/TrackList.vue +++ b/src/components/TrackList.vue @@ -2,7 +2,7 @@
- +
{{ rightClickedTrack.name }}
{{ rightClickedTrack.ar[0].name }}
@@ -68,6 +68,16 @@ export default { type: String, default: "default", }, + albumObject: { + type: Object, + default: () => { + return { + artist: { + name: "", + }, + }; + }, + }, }, data() { return { diff --git a/src/components/TrackListItem.vue b/src/components/TrackListItem.vue index 7f40e95..1a6ecb3 100644 --- a/src/components/TrackListItem.vue +++ b/src/components/TrackListItem.vue @@ -34,9 +34,11 @@
{{ track.name }} - - - - + {{ artist.name }}
{{ $t("artist.artist") }}
- {{ artist.musicSize }} {{ $t("common.songs") }} · - {{ artist.albumSize }} {{ $t("artist.withAlbums") }} · - {{ artist.mvSize }} {{ $t("artist.videos") }} + {{ artist.musicSize }} {{ $t("common.songs") }} + · + {{ artist.albumSize }} {{ $t("artist.withAlbums") }} + · + {{ artist.mvSize }} {{ $t("artist.videos") }}
@@ -57,21 +65,21 @@
-