UNPKG

1.22 kBTypeScriptView Raw
1import { ComponentType } from 'react'
2import { StandardProps } from './common'
3
4interface MovableAreaProps extends StandardProps {
5 /** 当里面的 movable-view 设置为支持双指缩放时,设置此值可将缩放手势生效区域修改为整个 movable-area
6 * @default false
7 * @supported weapp, tt
8 */
9 scaleArea?: boolean
10}
11
12/** movable-view 的可移动区域
13 * @classification viewContainer
14 * @supported weapp, rn
15 * @example_react
16 * ```tsx
17 * class App extends Components {
18 * render () {
19 * return (
20 * <MovableArea style='height: 200px; width: 200px; background: red;'>
21 * <MovableView style='height: 50px; width: 50px; background: blue;' direction='all'>旅行的意义</MovableView>
22 * </MovableArea>
23 * )
24 * }
25 * }
26 * ```
27 * @example_vue
28 * ```html
29 * <movable-area style='height: 200px; width: 200px; background: red;'>
30 * <movable-view style='height: 50px; width: 50px; background: blue;' direction='all'>在路上</movable-view>
31 * </movable-area>
32 * ```
33 * @see https://developers.weixin.qq.com/miniprogram/dev/component/movable-area.html
34 */
35declare const MovableArea: ComponentType<MovableAreaProps>
36
37export { MovableArea, MovableAreaProps }