ht.ui.DragHelper()

new DragHelper()

静态类
处理组件内部或者组件之间通过拖拽交换数据的需求

Methods

acceptDragDrop(targetView, cursor) → {void}

接受拖拽

Parameters:
Name Type Attributes Description
targetView ht.ui.View

接受拖拽的组件

cursor string | object <optional>

拖拽提示图标,可以是 Canvas 对象、Image 对象、矢量对象或注册的图片名称

Returns:
void

cancelDrag(event) → {void}

取消拖拽过程

Parameters:
Name Type Attributes Description
event object <optional>

事件对象

Returns:
void

doDrag(view, data, image, offsetX, offsetY) → {void}

开始拖拽组件

Parameters:
Name Type Attributes Description
view ht.ui.View

被拖拽的组件

data ht.Data <optional>

拖拽数据

image string | object <optional>

拖拽图片,可以是 Canvas 对象、Image 对象、矢量对象或注册的图片名称

offsetX number <optional>

图片左上角相对于鼠标在水平方向偏移量

offsetY number <optional>

图片左上角相对于鼠标在垂直方向偏移量

Returns:
void

isDragging(view) → {boolean}

判断组件是否正在拖拽

Parameters:
Name Type Attributes Description
view ht.ui.View <optional>

组件

Returns:
boolean