Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 默认值错误导致加载空节点 #2280

Merged
merged 9 commits into from
Aug 13, 2024
2 changes: 1 addition & 1 deletion src/components/CoverRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default {
props: {
items: { type: Array, required: true },
type: { type: String, required: true },
subText: { type: String, default: 'null' },
subText: { type: String, default: 'none' },
pan93412 marked this conversation as resolved.
Show resolved Hide resolved
subTextFontSize: { type: String, default: '16px' },
showPlayCount: { type: Boolean, default: false },
columnNumber: { type: Number, default: 5 },
Expand Down
9 changes: 8 additions & 1 deletion src/views/artist.vue
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ import {
followAArtist,
similarArtists,
} from '@/api/artist';
import { getTrackDetail } from '@/api/track';
import locale from '@/locale';
import { isAccountLoggedIn } from '@/utils/auth';
import NProgress from 'nprogress';
Expand Down Expand Up @@ -278,7 +279,7 @@ export default {
this.$parent.$refs.main.scrollTo({ top: 0 });
getArtist(id).then(data => {
this.artist = data.artist;
this.popularTracks = data.hotSongs;
this.setPopularTracks(data.hotSongs);
if (next !== undefined) next();
NProgress.done();
this.show = true;
Expand All @@ -295,6 +296,12 @@ export default {
this.similarArtists = data.artists;
});
},
setPopularTracks(hotSongs) {
const trackIDs = hotSongs.map(t => t.id);
getTrackDetail(trackIDs.join(',')).then(data => {
this.popularTracks = data.songs;
});
},
goToAlbum(id) {
this.$router.push({
name: 'album',
Expand Down