fix 隐藏当前播放窗口
This commit is contained in:
18
src/App.vue
18
src/App.vue
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user