mirror of
https://github.com/qier222/YesPlayMusic.git
synced 2024-11-25 09:41:49 +08:00
fix: 默认值错误导致加载空节点 (#2280)
This commit is contained in:
parent
7cb063d511
commit
bd5af9c721
|
@ -50,7 +50,7 @@ export default {
|
||||||
props: {
|
props: {
|
||||||
items: { type: Array, required: true },
|
items: { type: Array, required: true },
|
||||||
type: { type: String, required: true },
|
type: { type: String, required: true },
|
||||||
subText: { type: String, default: 'null' },
|
subText: { type: String, default: 'none' },
|
||||||
subTextFontSize: { type: String, default: '16px' },
|
subTextFontSize: { type: String, default: '16px' },
|
||||||
showPlayCount: { type: Boolean, default: false },
|
showPlayCount: { type: Boolean, default: false },
|
||||||
columnNumber: { type: Number, default: 5 },
|
columnNumber: { type: Number, default: 5 },
|
||||||
|
|
|
@ -185,6 +185,7 @@ import {
|
||||||
followAArtist,
|
followAArtist,
|
||||||
similarArtists,
|
similarArtists,
|
||||||
} from '@/api/artist';
|
} from '@/api/artist';
|
||||||
|
import { getTrackDetail } from '@/api/track';
|
||||||
import locale from '@/locale';
|
import locale from '@/locale';
|
||||||
import { isAccountLoggedIn } from '@/utils/auth';
|
import { isAccountLoggedIn } from '@/utils/auth';
|
||||||
import NProgress from 'nprogress';
|
import NProgress from 'nprogress';
|
||||||
|
@ -278,7 +279,7 @@ export default {
|
||||||
this.$parent.$refs.main.scrollTo({ top: 0 });
|
this.$parent.$refs.main.scrollTo({ top: 0 });
|
||||||
getArtist(id).then(data => {
|
getArtist(id).then(data => {
|
||||||
this.artist = data.artist;
|
this.artist = data.artist;
|
||||||
this.popularTracks = data.hotSongs;
|
this.setPopularTracks(data.hotSongs);
|
||||||
if (next !== undefined) next();
|
if (next !== undefined) next();
|
||||||
NProgress.done();
|
NProgress.done();
|
||||||
this.show = true;
|
this.show = true;
|
||||||
|
@ -295,6 +296,12 @@ export default {
|
||||||
this.similarArtists = data.artists;
|
this.similarArtists = data.artists;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
setPopularTracks(hotSongs) {
|
||||||
|
const trackIDs = hotSongs.map(t => t.id);
|
||||||
|
getTrackDetail(trackIDs.join(',')).then(data => {
|
||||||
|
this.popularTracks = data.songs;
|
||||||
|
});
|
||||||
|
},
|
||||||
goToAlbum(id) {
|
goToAlbum(id) {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
name: 'album',
|
name: 'album',
|
||||||
|
|
Loading…
Reference in New Issue
Block a user