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

This commit is contained in:
MTrun 2022-02-02 14:18:39 +08:00
parent ccf78c6dd2
commit 8ef13b6325

View File

@ -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()