lowcode-engine icon indicating copy to clipboard operation
lowcode-engine copied to clipboard

能提供更换引擎内部的内置拖拽替身API吗

Open 286yym opened this issue 3 years ago • 7 comments

Describe the bug (required) / 详细描述 bug(必填)

拖拽替身能否提供替换组件的功能,或者指定拖拽的文案内容 A clear and concise description of what the bug is. / 请提供清晰且精确的 bug 描述 功能需求

To Reproduce (required) / 如何复现 bug?(必填,非常重要)

Steps to reproduce the behavior: / 详细复现步骤:


Expected behavior (required) / 预期行为(必填,非常重要)

A clear and concise description of what did you expect to happen. / 请清晰和精确的描述你预期的行为 image 期望可以自己用组件覆盖,或者提供更改文案的API

Screenshots (optional) / bug 截图(可选)

Sceenshots for further information. (If applicable.) / 一些有用的截图将会帮助我们更好的明确以及定位问题


Environments (please complete the following information) (required): / 请提供如下信息(必填)

  • AliLowCodeEngine version: [e.g. 1.0.0] / 低代码引擎版本
  • AliLowCodeEngineExt version: [e.g. 1.0.0] / 低代码引擎扩展包版本
  • Browser [e.g. chrome, safari] / 浏览器版本
  • materials / plugins / tools / 其他物料 / 插件 / 工具链版本 最新

286yym avatar Aug 10 '22 09:08 286yym

Hello @286yym. We totally like your proposal/feedback, PR wanted。

你好 @286yym,我们完全同意你的提议/反馈,欢迎 PR。

github-actions[bot] avatar Aug 10 '22 10:08 github-actions[bot]

@LeoYuan 大佬也可以提供点思路

JackLian avatar Aug 10 '22 10:08 JackLian

被固定是什么意思?固定在那,不动了?

LeoYuan avatar Aug 10 '22 10:08 LeoYuan

https://github.com/alibaba/lowcode-engine/blob/4f4ac5115d18357a7399632860808f6cffc33fad/packages/designer/src/designer/designer-view.tsx#L53

倒是可以替换,不过没有对外暴露设置的 API~

LeoYuan avatar Aug 10 '22 10:08 LeoYuan

从左侧拖拽到布局中,拖拽替身没法更改

286yym avatar Aug 10 '22 10:08 286yym

const DragGhost = dragGhostComponent || BuiltinDragGhostComponent; 这个是引擎内部的,我外部没有得改

286yym avatar Aug 10 '22 10:08 286yym

你可以试着在改一下,支持在 engineConfig.set('dragGhostComponent', YourComponent),然后在 DesignerView 中 get,整体试下功能是否 OK~

然后方便的话,提个 PR😄

LeoYuan avatar Aug 11 '22 03:08 LeoYuan