Skip to main content
Version: 3.x

VerticalDragGestureHandler

纵向滑动时触发手势 微信小程序下 skyline 的手势标签,只能在 CompileMode 中使用

支持情况:

类型

ComponentType<VerticalDragGestureHandlerProps>

示例代码

import { Component } from 'react'
import { View, VerticalDragGestureHandler } from '@tarojs/components'

export function Index () {
return (
<View compileMode>
<VerticalDragGestureHandler onGestureWorklet="onGesture">
<View className='circle'></View>
</VerticalDragGestureHandler>
</View>
)
}

VerticalDragGestureHandlerProps

参数类型必填说明
tagstring声明手势协商时的组件标识
onGestureWorkletstring手势识别成功的回调
shouldResponseOnMoveWorkletstring手指移动过程中手势是否响应
shouldAcceptGestureWorkletstring手势是否应该被识别
simultaneousHandlersstring[]声明可同时触发的手势节点
nativeViewstring代理的原生节点类型

API 支持度

API微信小程序H5React NativeHarmony
VerticalDragGestureHandlerProps.tag✔️
VerticalDragGestureHandlerProps.onGestureWorklet✔️
VerticalDragGestureHandlerProps.shouldResponseOnMoveWorklet✔️
VerticalDragGestureHandlerProps.shouldAcceptGestureWorklet✔️
VerticalDragGestureHandlerProps.simultaneousHandlers✔️
VerticalDragGestureHandlerProps.nativeView✔️