1
import * as React from 'react';
2 4
import createHostComponent from '../../createHostComponent';
3
import { TapEvent } from '../../types';
4 4
import alias from './props/alias';
5 4
import defaults from './props/default';
6

7
export interface ButtonProps extends React.AriaAttributes {
8
  // 通用属性
9
  readonly dataset?: DOMStringMap;
10
  id?: string;
11
  className?: string;
12
  style?: React.CSSProperties;
13
  /** 是否禁用 */
14
  disabled?: boolean;
15
  /** 指定按钮按下去的样式类。当 hover-class="none" 时,没有点击态效果 */
16
  hoverClassName?: string;
17
  /** 按住后多久出现点击态,单位毫秒 */
18
  hoverStartTime?: number;
19
  /** 手指松开后点击态保留时间,单位毫秒 */
20
  hoverStayTime?: number;
21
  /** 指定是否阻止本节点的祖先节点出现点击态 */
22
  hoverStopPropagation?: boolean;
23
  /** 用于 form 组件,点击分别会触发 form 组件的 submit/reset 事件 */
24
  type?: 'submit' | 'reset';
25
  onTap?: (event: TapEvent) => void;
26
}
27

28 4
const Button: React.ComponentType<ButtonProps> = createHostComponent<ButtonProps>('button', alias, defaults);
29

30 4
export default Button;

Read our documentation on viewing source code .

Loading