Skip to content

Commit

Permalink
feat: 更新展示问题
Browse files Browse the repository at this point in the history
  • Loading branch information
tong committed May 31, 2024
1 parent 59d21a8 commit d44166f
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions dev/components/MuiscPlayer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
<div class="p-music" id="float-music">
<client-only>
<aplayer
autoplay
:autoplay="true"
:mini="mini"
show-lrc
shuffle
:listFolded="true"
:muted.sync="muted"
:volume.sync="volume"
Expand Down Expand Up @@ -74,6 +73,7 @@
}
],
mini: false,
autoplay: false,
volume: 0.7,
muted: false,
}
Expand Down Expand Up @@ -106,7 +106,7 @@
}
setTimeout(() => {
window.addEventListener("scroll", trackPos);
}, 2000);
}, 1000);
window.moveMusicBar = () => {
const musicBarEle = document.getElementById("float-music");
const timeInner = document.querySelectorAll(".aplayer-time-inner");
Expand All @@ -122,17 +122,19 @@
musicBarEle.style.position = 'fixed';
musicBarEle.style.display = "block"
}
}
const afterRouteListener = (before, after) => {
}
const afterRouteListener = (before, after) => {
if (before.path === "/") {
window.hompageRender();
setTimeout(() => {
window.hompageRender();
}, 1000);
} else {
window.moveMusicBar();
}
}
this.$router.afterHooks.push(afterRouteListener);
afterRouteListener(this.$route);
}
}
};
</script>

Expand Down

0 comments on commit d44166f

Please sign in to comment.