Home > SCH_PrimitiveComponent > placeComponentWithMouse
SCH_PrimitiveComponent.placeComponentWithMouse() method
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
使用鼠标放置器件
Signature
typescript
placeComponentWithMouse(component: {
libraryUuid: string;
uuid: string;
} | ILIB_DeviceItem, subPartName?: string): Promise<boolean>;
1
2
3
4
2
3
4
Parameters
Parameter | Type | Description |
---|---|---|
component | { libraryUuid: string; uuid: string; } | ILIB_DeviceItem | 关联库器件 |
subPartName | string | (Optional) |
Returns
Promise<boolean>
是否找到器件
Remarks
本接口模拟前端点击放置按钮,指定的器件将绑定到当前鼠标,并在用户后续点击时放置于画布
本接口的返回时机并不会等待用户的放置操作,一旦器件被绑定到鼠标,本接口将立即返回 true
的结果