fix: bugs

This commit is contained in:
qier222 2021-06-08 00:09:30 +08:00
parent 22c9691a73
commit c506dea02b
No known key found for this signature in database
GPG key ID: 9C85007ED905F14D
18 changed files with 79 additions and 32 deletions

View file

@ -261,18 +261,19 @@ export default {
this.loadData(this.$route.params.id);
},
activated() {
if (this.show) {
if (this.artist.id.toString() !== this.$route.params.id) {
this.show = false;
NProgress.start();
this.loadData(this.$route.params.id);
}
if (this.artist?.id?.toString() !== this.$route.params.id) {
this.loadData(this.$route.params.id);
} else {
this.$parent.$refs.scrollbar.restorePosition();
}
},
methods: {
...mapMutations(['appendTrackToPlayerList']),
...mapActions(['playFirstTrackOnList', 'playTrackOnListByID', 'showToast']),
loadData(id, next = undefined) {
NProgress.start();
this.show = false;
this.$parent.$refs.main.scrollTo({ top: 0 });
getArtist(id).then(data => {
this.artist = data.artist;
this.popularTracks = data.hotSongs;