mirror of
https://gitee.com/dromara/go-view.git
synced 2025-04-27 03:46:34 +08:00
新增右键自定义列表
This commit is contained in:
parent
ab05a6f384
commit
7002e64b8f
@ -125,7 +125,9 @@ const handleContextMenu = (
|
|||||||
// 隐藏选项列表
|
// 隐藏选项列表
|
||||||
hideOptionsList?: MenuEnum[],
|
hideOptionsList?: MenuEnum[],
|
||||||
// 挑选选项列表
|
// 挑选选项列表
|
||||||
pickOptionsList?: MenuEnum[]
|
pickOptionsList?: MenuEnum[],
|
||||||
|
// 自定义列表
|
||||||
|
defaultOptions?: MenuOptionsItemType[]
|
||||||
) => {
|
) => {
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
@ -134,8 +136,10 @@ const handleContextMenu = (
|
|||||||
target = target.parentNode
|
target = target.parentNode
|
||||||
}
|
}
|
||||||
chartEditStore.setRightMenuShow(false)
|
chartEditStore.setRightMenuShow(false)
|
||||||
|
|
||||||
// * 设置默认选项
|
// * 设置默认选项
|
||||||
menuOptions.value = defaultOptions
|
if(defaultOptions) menuOptions.value = defaultOptions || defaultOptions
|
||||||
|
|
||||||
if (!item) {
|
if (!item) {
|
||||||
menuOptions.value = pickOption(menuOptions.value, defaultNoItemKeys)
|
menuOptions.value = pickOption(menuOptions.value, defaultNoItemKeys)
|
||||||
}
|
}
|
||||||
@ -182,6 +186,7 @@ export const useContextMenu = () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
menuOptions,
|
menuOptions,
|
||||||
handleContextMenu,
|
handleContextMenu,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user