PanEvent
平移手势事件。
属性
属性名 | 类型 | 说明 | 示例 |
---|---|---|---|
type | string | 事件类型 | type: 'pan' |
state | number | 手势状态 | state: 0 // normal state: 1 // began state: 2 // changed state: 3 // ended state: 4 // cancelled |
timestamp | number | 时间戳 | timestamp: 1578973450142 |
translation | Object | 移动的偏移值(单位:dp或pt) | translation: {deltaX : 10, deltaY: 10} |
示例
Tenon Vue
html
<!-- App.vue -->
<template>
<view @pan="handlePan">
<text>Pan Demo</text>
</view>
</template>
<script>
export default {
methods: {
handlePan(){
Toast.show('Pan')
}
}
}
</script>
Tenon React
jsx
import React from "react"
import Tenon from "@hummer/tenon-react"
function App() {
function handlePan(){
Toast.show('Pan')
}
return (
<view onPan={handlePan}>
<text>Pan Demo</text>
</view>
);
}
Tenon.render(<App/>)