本文整理匯總了TypeScript中react-dnd-touch-backend.default函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript default函數的具體用法?TypeScript default怎麽用?TypeScript default使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了default函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: createDefaultMultiBackend
import { default as HTML5Backend } from "react-dnd-html5-backend";
import { default as TouchBackend } from "react-dnd-touch-backend";
import {
default as MultiBackend,
MouseTransition,
TouchTransition,
BackendTransition
} from "dnd-multi-backend";
import { BackendFactory } from 'dnd-core';
export const HTML5ToTouch = {
backends: [
{
backend: HTML5Backend,
transition: MouseTransition
},
{
backend: TouchBackend({ enableMouseEvents: false }),
preview: true,
transition: TouchTransition
}
] as BackendTransition[]
};
export function createDefaultMultiBackend(): BackendFactory {
return MultiBackend(HTML5ToTouch);
}
示例2: customMultiBackend
import { MouseTransition, MultiBackend } from '@angular-skyhook/multi-backend';
import { BackendTransition, TouchTransition } from 'dnd-multi-backend';
import { BackendFactory } from 'dnd-core';
import { default as HTML5Backend } from 'react-dnd-html5-backend';
import { default as TouchBackend } from 'react-dnd-touch-backend';
const backendTransitions: BackendTransition[] = [
{
backend: HTML5Backend,
transition: MouseTransition,
},
{
backend: TouchBackend({
enableMouseEvents: false,
ignoreContextMenu: true,
delayTouchStart: 300 // milliseconds
}),
transition: TouchTransition,
preview: true,
}
];
export function customMultiBackend(): BackendFactory {
return MultiBackend({ backends: backendTransitions });
}
示例3:
import * as ReactDnd from "react-dnd";
import TouchBackend from "react-dnd-touch-backend";
const component = () => null;
const dndComponent = ReactDnd.DragDropContext(TouchBackend)(component);
const dndComponentMouseEvents = ReactDnd.DragDropContext(TouchBackend({enableMouseEvents: true}))(component);
const dndComponentDelayTouchStart = ReactDnd.DragDropContext(TouchBackend({delayTouchStart: 200}))(component);
const dndComponentDelayMouseStart = ReactDnd.DragDropContext(TouchBackend({enableMouseEvents: true, delayMouseStart: 100}));
const dndComponentKeyboardEvents = ReactDnd.DragDropContext(TouchBackend({enableKeyboardEvents: true}));
const dndComponentOldDelay = ReactDnd.DragDropContext(TouchBackend({delay: 300}));
const dndComponentAllCurrentEvents = ReactDnd.DragDropContext(TouchBackend(
{enableKeyboardEvents: true, enableMouseEvents: true, delayMouseStart: 100, delayTouchStart: 200}));
const dndComponentWithScrollAngleRanges = ReactDnd.DragDropContext(TouchBackend(
{ scrollAngleRanges: [{ start: 0, end: 0 }, { start: 0 }, { end: 0 }] }));
const dndComponentWithTouchSlop = ReactDnd.DragDropContext(TouchBackend({ touchSlop: 0 }));
const dndComponentWithIgnoreContextMenu = ReactDnd.DragDropContext(TouchBackend({ ignoreContextMenu: true }));
示例4:
import * as ReactDnd from "react-dnd";
import TouchBackend from "react-dnd-touch-backend";
const component = () => null;
const dndComponent = ReactDnd.DragDropContext(TouchBackend)(component);
const dndComponentMouseEvents = ReactDnd.DragDropContext(TouchBackend({enableMouseEvents: true}))(component);
const dndComponentDelayTouchStart = ReactDnd.DragDropContext(TouchBackend({delayTouchStart: 200}))(component);
const dndComponentDelayMouseStart = ReactDnd.DragDropContext(TouchBackend({enableMouseEvents: true, delayMouseStart: 100}));
const dndComponentKeyboardEvents = ReactDnd.DragDropContext(TouchBackend({enableKeyboardEvents: true}));
const dndComponentOldDelay = ReactDnd.DragDropContext(TouchBackend({delay: 300}));
const dndComponentAllCurrentEvents = ReactDnd.DragDropContext(TouchBackend(
{enableKeyboardEvents: true, enableMouseEvents: true, delayMouseStart: 100, delayTouchStart: 200}));
示例5: createDragDropManager
import { createDragDropManager } from "dnd-core";
import TouchBackend from "react-dnd-touch-backend";
const context = {};
const dndComponent = createDragDropManager(TouchBackend(), context);
const dndComponentMouseEvents = createDragDropManager(TouchBackend({enableMouseEvents: true}), context);
const dndComponentDelayTouchStart = createDragDropManager(TouchBackend({delayTouchStart: 200}), context);
const dndComponentDelayMouseStart = createDragDropManager(TouchBackend({enableMouseEvents: true, delayMouseStart: 100}), context);
const dndComponentKeyboardEvents = createDragDropManager(TouchBackend({enableKeyboardEvents: true}), context);
const dndComponentOldDelay = createDragDropManager(TouchBackend({delay: 300}), context);
const dndComponentAllCurrentEvents = createDragDropManager(TouchBackend(
{enableKeyboardEvents: true, enableMouseEvents: true, delayMouseStart: 100, delayTouchStart: 200}), context);
const dndComponentWithScrollAngleRanges = createDragDropManager(TouchBackend(
{ scrollAngleRanges: [{ start: 0, end: 0 }, { start: 0 }, { end: 0 }] }), context);
const dndComponentWithTouchSlop = createDragDropManager(TouchBackend({ touchSlop: 0 }), context);
const dndComponentWithIgnoreContextMenu = createDragDropManager(TouchBackend({ ignoreContextMenu: true }), context);