parent
1ad92a2d1b
commit
639c4458be
@ -56,7 +56,7 @@
|
|||||||
"@better-scroll/core": "^2.4.2",
|
"@better-scroll/core": "^2.4.2",
|
||||||
"@soybeanjs/vue-admin-layout": "^1.1.1",
|
"@soybeanjs/vue-admin-layout": "^1.1.1",
|
||||||
"@soybeanjs/vue-admin-tab": "^1.0.5",
|
"@soybeanjs/vue-admin-tab": "^1.0.5",
|
||||||
"@vueuse/core": "^9.1.0",
|
"@vueuse/core": "^9.1.1",
|
||||||
"axios": "^0.27.2",
|
"axios": "^0.27.2",
|
||||||
"clipboard": "^2.0.11",
|
"clipboard": "^2.0.11",
|
||||||
"colord": "^2.9.3",
|
"colord": "^2.9.3",
|
||||||
@ -87,7 +87,7 @@
|
|||||||
"@soybeanjs/eslint-config": "0.2.10",
|
"@soybeanjs/eslint-config": "0.2.10",
|
||||||
"@types/bmapgl": "^0.0.5",
|
"@types/bmapgl": "^0.0.5",
|
||||||
"@types/crypto-js": "^4.1.1",
|
"@types/crypto-js": "^4.1.1",
|
||||||
"@types/node": "^18.7.9",
|
"@types/node": "^18.7.11",
|
||||||
"@types/qs": "^6.9.7",
|
"@types/qs": "^6.9.7",
|
||||||
"@types/ua-parser-js": "^0.7.36",
|
"@types/ua-parser-js": "^0.7.36",
|
||||||
"@vitejs/plugin-vue": "^3.0.3",
|
"@vitejs/plugin-vue": "^3.0.3",
|
||||||
|
@ -18,10 +18,11 @@
|
|||||||
</component>
|
</component>
|
||||||
</div>
|
</div>
|
||||||
<context-menu
|
<context-menu
|
||||||
v-model:visible="dropdown.visible"
|
:visible="dropdown.visible"
|
||||||
:current-path="dropdown.currentPath"
|
:current-path="dropdown.currentPath"
|
||||||
:x="dropdown.x"
|
:x="dropdown.x"
|
||||||
:y="dropdown.y"
|
:y="dropdown.y"
|
||||||
|
@update:visible="handleDropdownVisible"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -76,14 +77,31 @@ function setDropdown(x: number, y: number, currentPath: string) {
|
|||||||
Object.assign(dropdown, { x, y, currentPath });
|
Object.assign(dropdown, { x, y, currentPath });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let isClickContextMenu = false;
|
||||||
|
|
||||||
|
function handleDropdownVisible(visible: boolean) {
|
||||||
|
if (!isClickContextMenu) {
|
||||||
|
dropdown.visible = visible;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** 点击右键菜单 */
|
/** 点击右键菜单 */
|
||||||
async function handleContextMenu(e: MouseEvent, fullPath: string) {
|
async function handleContextMenu(e: MouseEvent, fullPath: string) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
const { clientX, clientY } = e;
|
const { clientX, clientY } = e;
|
||||||
|
|
||||||
|
isClickContextMenu = true;
|
||||||
|
|
||||||
|
const DURATION = dropdown.visible ? 150 : 0;
|
||||||
|
|
||||||
hideDropdown();
|
hideDropdown();
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
setDropdown(clientX, clientY, fullPath);
|
setDropdown(clientX, clientY, fullPath);
|
||||||
await nextTick();
|
|
||||||
showDropdown();
|
showDropdown();
|
||||||
|
isClickContextMenu = false;
|
||||||
|
}, DURATION);
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
|
Loading…
Reference in New Issue
Block a user