Explorar o código

fix: 修改拖拽之后未选中的问题

MTrun %!s(int64=3) %!d(string=hai) anos
pai
achega
9876c7a802
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      src/views/chart/ContentEdit/hooks/useDrop.hook.ts

+ 2 - 2
src/views/chart/ContentEdit/hooks/useDrop.hook.ts

@@ -26,11 +26,11 @@ export const handleDrop = async (e: DragEvent) => {
       drayDataString
     )
     // 创建新图表组件
-    let newComponent = await createComponent(dropData)
+    let newComponent:CreateComponentType = await createComponent(dropData)
 
     newComponent.setPosition(e.offsetX - newComponent.attr.w / 2, e.offsetY - newComponent.attr.h / 2)
     chartEditStore.addComponentList(newComponent)
-
+    chartEditStore.setTargetSelectChart(newComponent.id) 
     loadingFinish()
   } catch (error) {
     loadingError()