Skip to content

Commit bd5af9c

Browse files
authored
fix: 默认值错误导致加载空节点 (#2280)
1 parent 7cb063d commit bd5af9c

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/components/CoverRow.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export default {
5050
props: {
5151
items: { type: Array, required: true },
5252
type: { type: String, required: true },
53-
subText: { type: String, default: 'null' },
53+
subText: { type: String, default: 'none' },
5454
subTextFontSize: { type: String, default: '16px' },
5555
showPlayCount: { type: Boolean, default: false },
5656
columnNumber: { type: Number, default: 5 },

src/views/artist.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ import {
185185
followAArtist,
186186
similarArtists,
187187
} from '@/api/artist';
188+
import { getTrackDetail } from '@/api/track';
188189
import locale from '@/locale';
189190
import { isAccountLoggedIn } from '@/utils/auth';
190191
import NProgress from 'nprogress';
@@ -278,7 +279,7 @@ export default {
278279
this.$parent.$refs.main.scrollTo({ top: 0 });
279280
getArtist(id).then(data => {
280281
this.artist = data.artist;
281-
this.popularTracks = data.hotSongs;
282+
this.setPopularTracks(data.hotSongs);
282283
if (next !== undefined) next();
283284
NProgress.done();
284285
this.show = true;
@@ -295,6 +296,12 @@ export default {
295296
this.similarArtists = data.artists;
296297
});
297298
},
299+
setPopularTracks(hotSongs) {
300+
const trackIDs = hotSongs.map(t => t.id);
301+
getTrackDetail(trackIDs.join(',')).then(data => {
302+
this.popularTracks = data.songs;
303+
});
304+
},
298305
goToAlbum(id) {
299306
this.$router.push({
300307
name: 'album',

0 commit comments

Comments
 (0)