fix(Player Card): 弹出 Card 时,禁止页面滚动

feature/artists
mackt 7 months ago
parent c5ffa7d22c
commit 140aba42f6

@ -126,6 +126,15 @@ export default function AudioPlayer({
setVolume(value);
};
// 弹出 Card 时,禁止页面滚动
useEffect(() => {
if (showCard) {
document.body.style.setProperty('overflow-y', 'hidden', 'important');
} else {
document.body.style.removeProperty('overflow-y');
}
}, [showCard]);
// 播放/暂停事件
useEffect(() => {
audioRef.current.volume = volume / 100;

Loading…
Cancel
Save