fix 隐藏当前播放窗口

This commit is contained in:
zilong
2021-10-30 13:09:11 +08:00
parent 69643be75a
commit 03542b80a7
4 changed files with 41 additions and 24 deletions

View File

@@ -87,16 +87,16 @@ onUnmounted(() => {
pubsub.unsubscribe(token);
});
const c = (item) => {
return (
item.id == "playingList" ||
item.id == "top" ||
item.id == "footer"
);
};
const wpEl = ref('')
const hideWins = (e) => {
if (showPlaying.value && e.path.findIndex(c) < 0) {
// console.log(e.clientX > 0,e, wpEl.value.clientWidth);
if (showPlaying.value
&& e.clientX > 0
&& e.clientX < wpEl.value.clientWidth - 500
&& e.clientY > 40
&& e.clientY < wpEl.value.clientHeight - 64
) {
showPlaying.value = false;
}
};
@@ -107,7 +107,7 @@ const hideWins = (e) => {
:theme-overrides="store.state.theme.themeOverrides"
>
<n-message-provider>
<div id="wp" @click="hideWins">
<div id="wp" ref="wpEl" @click="hideWins">
<!-- <NThemeEditor/> -->
<div id="top">
<Nav></Nav>