本文整理匯總了TypeScript中dnd-core.IDragDropManager類的典型用法代碼示例。如果您正苦於以下問題:TypeScript IDragDropManager類的具體用法?TypeScript IDragDropManager怎麽用?TypeScript IDragDropManager使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了IDragDropManager類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: registerTarget
export default function registerTarget(
type: string,
target: IDropTarget,
manager: IDragDropManager<any>,
): { handlerId: string; unregister: Unsubscribe } {
const registry = manager.getRegistry()
const targetId = registry.addTarget(type, target)
function unregisterTarget() {
registry.removeTarget(targetId)
}
return {
handlerId: targetId,
unregister: unregisterTarget,
}
}
示例2: registerSource
export default function registerSource(
type: string,
source: IDragSource,
manager: IDragDropManager<any>,
): {
handlerId: string
unregister: Unsubscribe
} {
const registry = manager.getRegistry()
const sourceId = registry.addSource(type, source)
function unregisterSource() {
registry.removeSource(sourceId)
}
return {
handlerId: sourceId,
unregister: unregisterSource,
}
}
示例3: constructor
constructor(manager: IDragDropManager<any>) {
this.internalMonitor = manager.getMonitor()
}