Giter Site home page Giter Site logo

wmp-swipeout's Introduction

wmp-swipeout

微信小程序左滑删除组件

使用指南

在需要使用的页面的json中配置

{
  "usingComponents": {
     "swipeout": "path/to/swipeout",
     "swipeout-item": "path/to/swipeoutItem"
  }
}

然后再页面中

<swipeout>
  <swipeout-item>
    <view slot="right">del</view>
    <view slot="content">xxxx</view>
  </swipeout-item>
</swipeout>

需要注意的是: 使用时<swipeout>的子元素只能是<swipeout-item>,否则可能会出错.

properties和triggerEvent

properties

properties 说明 类型 默认 必须
threshold 阈值, 右部按钮的百分比, 大于或等于该值, 撒手时,可以自动关闭或打开 Boolean 0.3 no
open 是否打开 Boolean false no
identifier 标识 Number/String yes

triggerEvent

event 说明 参数
righttap  删除按钮点击  {identifier: 传入的identifier properties}
contenttap  内容点击  {identifier: 传入的identifier properties}

预览

preview

不足

内容区域的touchstart和tap两个事件会有重叠,希望看到的朋友给我建议

wmp-swipeout's People

Contributors

khunzh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.