Compare commits

..

3 Commits
0.0.1 ... main

Author SHA1 Message Date
cuidongdong 750d874228 Add useRightMenu.ts
Signed-off-by: cuidongdong <515783741@qq.com>
2024-07-04 09:57:47 +08:00
cuidongdong cb227184ec Add image2024-6-4_11-43-43.png
Signed-off-by: cuidongdong <515783741@qq.com>
2024-07-04 09:57:06 +08:00
cuidongdong 63e5306270 Add 1.png
Signed-off-by: cuidongdong <515783741@qq.com>
2024-07-04 09:56:48 +08:00
3 changed files with 35 additions and 0 deletions

BIN
1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
image2024-6-4_11-43-43.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

35
useRightMenu.ts Normal file
View File

@ -0,0 +1,35 @@
import { ref } from 'vue'
interface MenuItem {
text: string
click: () => void
keyCode?: string
}
interface ShowMenuConfig {
x: number
y: number
items: MenuItem[]
}
const visible = ref()
const x = ref()
const y = ref()
const items = ref<MenuItem[]>()
export function useRightMenu() {
function showMenu(config: ShowMenuConfig) {
x.value = config.x
y.value = config.y
items.value = config.items
visible.value = true
}
function hideMenu() {
visible.value = false
}
return {
x,
y,
items,
visible,
showMenu,
hideMenu
}
}