1
import * as React from 'react';
2 3
import { createHostComponent } from '@remax/runtime';
3
import { BaseProps, TouchEvent } from '../../types/component';
4

5
export interface ViewProps extends BaseProps {
6
  slot?: string;
7
  /** 指定按下去的样式类。当为 "none" 时,没有点击态效果 1.0.0  */
8
  hoverClassName?: string;
9
  /** 指定是否阻止本节点的祖先节点出现点击态 1.5.0  */
10
  hoverStopPropagation?: boolean;
11
  /** (default: 50) 按住后多久出现点击态,单位毫秒 1.0.0  */
12
  hoverStartTime?: number;
13
  /** (default: 400) 手指松开后点击态保留时间,单位毫秒 1.0.0  */
14
  hoverStayTime?: number;
15
  disableScroll?: boolean;
16
  onTouchStart?: (event: TouchEvent) => any;
17
  onTouchMove?: (event: TouchEvent) => any;
18
  onTouchEnd?: (event: TouchEvent) => any;
19
  onTouchCancel?: (event: TouchEvent) => any;
20
  onLongClick?: (event: TouchEvent) => any;
21
  onTransitionEnd?: (event: any) => any;
22
  onAnimationIteration?: (event: any) => any;
23
  onAnimationStart?: (event: any) => any;
24
  onAnimationEnd?: (event: any) => any;
25
  catchTouchMove?: boolean | ((event: TouchEvent) => any);
26
}
27
/**
28
 * https://developers.weixin.qq.com/miniprogram/dev/component/view.html
29
 */
30 3
export const View: React.ComponentType<ViewProps> = createHostComponent<ViewProps>('view');
31

32 3
View.defaultProps = {
33
  hoverClassName: 'none',
34
  hoverStopPropagation: false,
35
  hoverStartTime: 50,
36
  hoverStayTime: 400,
37
};

Read our documentation on viewing source code .

Loading