Skip to content

自定义滑动 v1.1.0 ​

方法名 ​

slide

用法 ​

  • 用法如下:
    js
    module.slide({
      //起始X坐标(相对屏幕)
      startX: 300,
      //起点Y坐标(相对屏幕)
      startY: 300,
      //终点X坐标(相对屏幕)
      endX: 500,
      //终点Y坐标(相对屏幕)
      endY: 300,
      //滑动时长,单位:毫秒
      duration: 500
    }, res => {})
  • 参数说明
    参数名参数类型是否必填默认值参数描述
    startXInteger是无起始X坐标(相对屏幕)
    startYInteger是无起点Y坐标(相对屏幕)
    endXInteger是无终点X坐标(相对屏幕)
    endYInteger是无终点Y坐标(相对屏幕)
    durationInteger是无滑动时长,单位:毫秒

回调 ​

  • 示例
    json
    {
      "data": {},
      "message": "",
      "code": 0
    }
  • 回调说明:
    参数名参数类型参数描述
    messageString消息提示
    dataObject数据对象
    codeInteger返回类型,0.成功,其他:失败