mine-h5-ui
Version:
一款轻量级、模块化基于 Vue3.x 的 H5 前端 UI 组件库 👍
35 lines (34 loc) • 870 B
TypeScript
import { USEMoveHandle } from './types';
export * from './types';
/**
* 移动操作处理
* 鼠标按下, 移动, 抬起
* 触摸开始, 移动, 结束
* @example
* ```ts
* import { useTemplateRef } from 'vue'
* import { useMoveHandle } from 'mine-h5-ui'
* const nodeRef = useTemplateRef('demo')
*
* interface OptionEvent {
* x: number
* y: number
* type: string
* }
*
* const option = {
* start(e: OptionEvent){
* console.log(e) // { x: 0, y: 0, type: 'touchstart' }
* },
* move(e: OptionEvent){
* console.log(e) // { x: 0, y: 0, type: 'touchdown' }
* },
* end(e: OptionEvent){
* console.log(e) // { x: 0, y: 0, type: 'touchend' }
* }
* }
*
* useMoveHandle(nodeRef.value, option)
* ```
*/
export declare const useMoveHandle: (nodeRef: HTMLElement, option: Partial<USEMoveHandle.Option>) => void;