填寫這份《一分鐘調查》,幫我們(開發組)做得更好!去填寫Home

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 事件的識別,請指定 {"rotate": {"enable": false}}

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 {"rotate": {"enable": false}}.

未提供的屬性採用 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.

      
      buildHammer(element: HTMLElement): HammerInstance
    
引數
element HTMLElement

要識別手勢的元素。

The element that will recognize gestures.

返回值

一個 HammerJS 事件管理器物件。

HammerInstance: A HammerJS event-manager object.