alibaba / alibaba/lowcode-engine
plugin-designer插件DesignerView设置onDragend(e, loc),loc为undefined
- Dominant language
- TypeScript
- Stars
- 15.9k
- Forks
- 2.7k
- PR merge metrics
- No merged PRs in 30d
Description
## **Describe the bug (required)** / **详细描述 bug(必填)**
当为plugin-designer插件中DesignerView组件设置onDragend(e, loc),loc为undefined,获取不到位置信息。
并且为node设置style后,右侧属性面板不更新,但是预览已更新。
```
node.setPropValue('style', {
position: 'absolute',
left: loc?.event.canvasX,
top: loc?.event.canvasY,
);
```
---
## **To Reproduce (required)** / **如何复现 bug?(必填,非常重要)**
1. 打开 [plugin-designer插件](https://github.com/alibaba/lowcode-engine/blob/main/packages/plugin-designer/src/index.tsx);
2. DesignerView组件增加属性onDragend(e, loc)
```
onDragend={(e, loc) => {
const { dragObject } = e;
console.log('loc', loc);
const node = dragObject?.nodes?.[0];
if (!node || !loc) return;
node.setPropValue('style', {
position: 'absolute',
left: loc?.event.canvasX,
top: loc?.event.canvasY,
});
}}
```
3. 打印的loc为undefined
4. 右侧属性面板布局属性无法更新
## **Expected behavior (required)** / **预期行为(必填,非常重要)**
希望能获取到loc位置属性信息。
同时当设置节点属性值时,右侧面板布局属性能更新,预览也是正确的。
---
## **Screenshots (optional)** / **bug 截图(可选)**

---
## **Environments (please complete the following information) (required):** / **请提供如下信息(必填)**
- AliLowCodeEngine version: [e.g. 1.0.8] / 低代码引擎版本
- AliLowCodeEngineExt version: [e.g. 1.0.3] / 低代码引擎扩展包版本
- Browser [e.g. chrome] / 浏览器版本
- @alilc/lowcode-plugin-designer: [e.g. 1.0.8]
> (this information can be collected via [the manual plugin](https://img.alicdn.com/imgextra/i1/O1CN0115zonY1IsgbkZ2ir7_!!6000000000949-2-tps-3066-1650.png) / 版本信息可[通过低代码用户手册插件收集](https://img.alicdn.com/imgextra/i1/O1CN0115zonY1IsgbkZ2ir7_!!6000000000949-2-tps-3066-1650.png))
## **Additional context (optional)** / **更多额外信息(可选)**
AliLowCodeEngine version: [e.g. 1.0.6] / 低代码引擎版本时,可以获取到位置信息,但是设置节点属性后,右侧属性面板中的布局信息未更改,但是预览是正确的。
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.