Skip to content

Commit b7d32fe

Browse files
JackLianliujuping
authored andcommitted
fix: error when dragging in outline view
1 parent 9444752 commit b7d32fe

4 files changed

Lines changed: 80 additions & 7 deletions

File tree

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
title: DropLocation
3+
sidebar_position: 13
4+
---
5+
6+
> **@types** [IPublicModelDropLocation](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/model/drop-location.ts)<br/>
7+
> **@since** v1.1.0
8+
9+
10+
## 基本介绍
11+
12+
拖拽放置位置模型
13+
14+
## 变量
15+
16+
### target
17+
18+
拖拽放置位置目标
19+
20+
`@type {IPublicModelNode}`
21+
22+
相关类型:[IPublicModelNode](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/model/node.ts)
23+
24+
### detail
25+
26+
拖拽放置位置详情
27+
28+
`@type {IPublicTypeLocationDetail}`
29+
30+
相关类型:[IPublicTypeLocationDetail](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/type/location-detail.ts)
31+
32+
### event
33+
34+
拖拽放置位置对应的事件
35+
36+
`@type {IPublicTypeLocationDetail}`
37+
38+
相关类型:[IPublicModelLocateEvent](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/model/location-event.ts)
39+
40+
## 方法签名
41+
42+
### clone
43+
44+
获取一份当前对象的克隆
45+
46+
```typescript
47+
/**
48+
* 获取一份当前对象的克隆
49+
* get a clone object of current dropLocation
50+
*/
51+
clone(event: IPublicModelLocateEvent): IPublicModelDropLocation;
52+
```
53+
54+
相关类型:[IPublicModelLocateEvent](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/model/location-event.ts)

‎packages/designer/src/designer/location.ts‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,6 @@ export function getWindow(elem: Element | Document): Window {
101101
}
102102
export interface IDropLocation extends IPublicModelDropLocation {
103103

104-
readonly target: INode;
105-
106-
readonly event: ILocateEvent;
107-
108104
readonly source: string;
109105

110106
get document(): IPublicModelDocumentModel;

‎packages/shell/src/model/drop-location.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ export class DropLocation implements IPublicModelDropLocation {
2727
return this[dropLocationSymbol].detail;
2828
}
2929

30+
get event(): IPublicModelLocateEvent {
31+
return this[dropLocationSymbol].event;
32+
}
33+
3034
clone(event: IPublicModelLocateEvent): IPublicModelDropLocation {
3135
return new DropLocation(this[dropLocationSymbol].clone(event));
3236
}
Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,29 @@
11
import { IPublicTypeLocationDetail } from '../type';
2-
import { IPublicModelLocateEvent } from './';
2+
import { IPublicModelLocateEvent, IPublicModelNode } from './';
33

44
export interface IPublicModelDropLocation {
5-
get target(): any;
65

7-
readonly detail: IPublicTypeLocationDetail;
6+
/**
7+
* 拖拽位置目标
8+
* get target of dropLocation
9+
*/
10+
get target(): IPublicModelNode;
811

12+
/**
13+
* 拖拽放置位置详情
14+
* get detail of dropLocation
15+
*/
16+
get detail(): IPublicTypeLocationDetail;
17+
18+
/**
19+
* 拖拽放置位置对应的事件
20+
* get event of dropLocation
21+
*/
22+
get event(): IPublicModelLocateEvent;
23+
24+
/**
25+
* 获取一份当前对象的克隆
26+
* get a clone object of current dropLocation
27+
*/
928
clone(event: IPublicModelLocateEvent): IPublicModelDropLocation;
1029
}

0 commit comments

Comments
 (0)