HammerGestureConfig
用于手势识别的可注入 HammerJS 管理器。配置事件识别的选项。
An injectable HammerJS Manager for gesture recognition. Configures specific event recognition.
class HammerGestureConfig {
events: string[]
overrides: {...}
options?: {...}
buildHammer(element: HTMLElement): HammerInstance
}
属性
属性 | 说明 |
---|---|
events: string[] | Angular 中所用的一组受支持的手势事件名。Angular 支持所有的内置识别器,如 HammerJS 文档中所列。 A set of supported event names for gestures to be used in Angular. Angular supports all built-in recognizers, as listed in HammerJS documentation. |
overrides: { [key: string]: Object; } | 将手势事件名映射到一组配置选项,这些配置选项用于覆盖特定属性的默认值。 Maps gesture event names to a set of configuration options that specify overrides to the default values for specific properties. 键名是要配置的受支持事件名称,options 对象包含一组属性,以及将套用到命名识别器事件的替代值。例如,要禁用对 Rotate 事件的识别,请指定 The key is a supported event name to be configured, and the options object contains a set of properties, with override values to be applied to the named recognizer event. For example, to disable recognition of the rotate event, specify 未提供的属性采用 HammerJS 默认值。有关哪些事件支持哪些属性以及它们的允许值和默认值的信息,请参见 HammerJS 文档。 Properties that are not present take the HammerJS default values. For information about which properties are supported for which events, and their allowed and default values, see HammerJS documentation. |
options?: { cssProps?: any; domEvents?: boolean; enable?: boolean | ((manager: any) => boolean); preset?: any[]; touchAction?: string; recognizers?: any[]; inputClass?: any; inputTarget?: EventTarget; } | 用来为给定事件覆盖其默认值的属性。不同的属性集适用于不同的事件。有关哪些事件支持哪些属性以及它们的允许值和默认值的信息,请参见 HammerJS 文档。 Properties whose default values can be overridden for a given event. Different sets of properties apply to different events. For information about which properties are supported for which events, and their allowed and default values, see HammerJS documentation. |
方法
创建一个 HammerJS 管理器,并将其附加到给定的 HTML 元素。 Creates a HammerJS Manager and attaches it to a given HTML element. |