mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-16 21:28:06 +00:00
refactor: only show NProgress when loading time is too long
This commit is contained in:
parent
723cf1b3b3
commit
f89fc84f95
11 changed files with 33 additions and 35 deletions
|
|
@ -159,12 +159,13 @@ export default {
|
|||
ContextMenu,
|
||||
},
|
||||
beforeRouteUpdate(to, from, next) {
|
||||
NProgress.start();
|
||||
this.show = false;
|
||||
this.loadData(to.params.id);
|
||||
next();
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
album: {
|
||||
id: 0,
|
||||
picUrl: '',
|
||||
|
|
@ -174,7 +175,6 @@ export default {
|
|||
},
|
||||
tracks: [],
|
||||
showFullDescription: false,
|
||||
show: false,
|
||||
moreAlbums: [],
|
||||
dynamicDetail: {},
|
||||
subtitle: '',
|
||||
|
|
@ -206,11 +206,6 @@ export default {
|
|||
}
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
album: function () {
|
||||
this.$parent.$refs.main.scrollTo({ top: 0 });
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.loadData(this.$route.params.id);
|
||||
},
|
||||
|
|
@ -256,6 +251,9 @@ export default {
|
|||
}
|
||||
},
|
||||
loadData(id) {
|
||||
setTimeout(() => {
|
||||
if (!this.show) NProgress.start();
|
||||
}, 1000);
|
||||
getAlbum(id).then(data => {
|
||||
this.album = data.album;
|
||||
this.tracks = data.songs;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue