perf: 优化层级中分组的右键功能

This commit is contained in:
奔跑的面条 2022-08-17 17:56:20 +08:00
parent d09d1b96be
commit 2ad3677fdc

View File

@ -34,7 +34,7 @@
@mousedown="mousedownHandle($event, element, componentGroupData.id)"
@mouseenter="mouseenterHandle(element)"
@mouseleave="mouseleaveHandle(element)"
@contextmenu="handleContextMenu($event, componentGroupData, undefined, undefined, pickOptionsList)"
@contextmenu="handleContextMenu($event, componentGroupData, optionsHandle)"
></LayersListItem>
</n-collapse-transition>
</div>
@ -144,21 +144,21 @@ const groupMousedownHandle = (e: MouseEvent) => {
}
//
const mousedownHandle = (e: MouseEvent, item: CreateComponentType | CreateComponentGroupType, id?: string) => {
const mousedownHandle = (e: MouseEvent, componentInstance: CreateComponentType | CreateComponentGroupType, id?: string) => {
e.preventDefault()
e.stopPropagation()
onClickOutSide()
chartEditStore.setTargetSelectChart(id || item.id)
chartEditStore.setTargetSelectChart(id || componentInstance.id)
}
//
const mouseenterHandle = (item: CreateComponentType | CreateComponentGroupType) => {
chartEditStore.setTargetHoverChart(item.id)
const mouseenterHandle = (componentInstance: CreateComponentType | CreateComponentGroupType) => {
chartEditStore.setTargetHoverChart(componentInstance.id)
}
//
const mouseleaveHandle = (item: CreateComponentType | CreateComponentGroupType) => {
const mouseleaveHandle = (componentInstance: CreateComponentType | CreateComponentGroupType) => {
chartEditStore.setTargetHoverChart(undefined)
}
</script>