當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript dnd-core.DragDropManager類代碼示例

本文整理匯總了TypeScript中dnd-core.DragDropManager的典型用法代碼示例。如果您正苦於以下問題:TypeScript DragDropManager類的具體用法?TypeScript DragDropManager怎麽用?TypeScript DragDropManager使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了DragDropManager類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1:

export default function registerTarget<Context>(
	type: TargetType,
	target: DropTarget,
	manager: DragDropManager<Context>,
): [Identifier, Unsubscribe] {
	const registry = manager.getRegistry()
	const targetId = registry.addTarget(type, target)

	return [targetId, () => registry.removeTarget(targetId)]
}
開發者ID:gaearon,項目名稱:react-dnd,代碼行數:10,代碼來源:registerTarget.ts

示例2:

export default function registerSource<Context>(
	type: SourceType,
	source: DragSource,
	manager: DragDropManager<Context>,
): [Identifier, Unsubscribe] {
	const registry = manager.getRegistry()
	const sourceId = registry.addSource(type, source)

	return [sourceId, () => registry.removeSource(sourceId)]
}
開發者ID:gaearon,項目名稱:react-dnd,代碼行數:10,代碼來源:registerSource.ts

示例3: registerSource

export default function registerSource(type: any, source: DragSource, manager: DragDropManager<any>) {
  const registry = manager.getRegistry();
  const sourceId = registry.addSource(type, source);

  function unregisterSource() {
    registry.removeSource(sourceId);
  }

  return {
    handlerId: sourceId,
    unregister: unregisterSource,
  };
}
開發者ID:fossabot,項目名稱:angular-skyhook,代碼行數:13,代碼來源:register-source.ts

示例4: registerTarget

export default function registerTarget(type: any, target: DropTarget, manager: DragDropManager<any>) {
  const registry = manager.getRegistry();
  const targetId = registry.addTarget(type, target);

  function unregisterTarget() {
    registry.removeTarget(targetId);
  }

  return {
    handlerId: targetId,
    unregister: unregisterTarget,
  };
}
開發者ID:fossabot,項目名稱:angular-skyhook,代碼行數:13,代碼來源:register-target.ts

示例5: unregisterTarget

export default function registerTarget<Context>(
	type: string,
	target: DropTarget,
	manager: DragDropManager<Context>,
): { handlerId: string; unregister: Unsubscribe } {
	const registry = manager.getRegistry()
	const targetId = registry.addTarget(type, target)

	function unregisterTarget() {
		registry.removeTarget(targetId)
	}

	return {
		handlerId: targetId,
		unregister: unregisterTarget,
	}
}
開發者ID:chenermeng,項目名稱:react-dnd,代碼行數:17,代碼來源:registerTarget.ts

示例6: unregisterSource

export default function registerSource<Context>(
	type: string,
	source: DragSource,
	manager: DragDropManager<Context>,
): {
	handlerId: string
	unregister: Unsubscribe
} {
	const registry = manager.getRegistry()
	const sourceId = registry.addSource(type, source)

	function unregisterSource() {
		registry.removeSource(sourceId)
	}

	return {
		handlerId: sourceId,
		unregister: unregisterSource,
	}
}
開發者ID:chenermeng,項目名稱:react-dnd,代碼行數:20,代碼來源:registerSource.ts

示例7: constructor

	constructor(manager: DragDropManager<any>) {
		this.internalMonitor = manager.getMonitor()
	}
開發者ID:chenermeng,項目名稱:react-dnd,代碼行數:3,代碼來源:createTargetMonitor.ts


注:本文中的dnd-core.DragDropManager類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。