当前位置: 首页>>代码示例>>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;未经允许,请勿转载。