屏蔽浏览器自带右键菜单

This commit is contained in:
fangxiang 2022-04-15 15:39:45 +08:00
parent 509fed80d4
commit 410633e04f
1 changed files with 12 additions and 0 deletions

View File

@ -1,6 +1,7 @@
<template> <template>
<div class="fit"> <div class="fit">
<q-ajax-bar position="top" color="accent" size="5px" skip-hijack /> <q-ajax-bar position="top" color="accent" size="5px" skip-hijack />
<q-menu context-menu />
<router-view /> <router-view />
</div> </div>
</template> </template>
@ -37,9 +38,20 @@ export default defineComponent({
}; };
window.document.body.onclick = (evt: any) => { window.document.body.onclick = (evt: any) => {
if ((<any>window).touchPriority) {
return;
}
EventBus.getInstance().emit(EventNamesDefine.DocumentBodyClick, evt); EventBus.getInstance().emit(EventNamesDefine.DocumentBodyClick, evt);
}; };
if ("ontouchstart" in document.documentElement === true) {
window.document.body.ontouchstart = (evt: any) => {
if ((<any>window).touchPriority) {
EventBus.getInstance().emit(EventNamesDefine.DocumentBodyClick, evt);
}
};
}
document.body.classList.add("overflow-hidden"); document.body.classList.add("overflow-hidden");
(window as any).controlLogout = () => { (window as any).controlLogout = () => {