Code Monkey home page Code Monkey logo

react-scroll-picker's Introduction

react-scroll-picker

使用 React 进行开发的适用于移动端的滚动选择器

预览

demo.gif

在线 demo

codeSandbox

属性说明

data

提供选择的数组数据,形如:

const data = [
  {
    label: "选项1",
    value: "此选项的值",
  },
  {
    label: "选项2",
    value: "此选项的值",
  },
];

value

绑定选中的值,如果一开始为空,会默认选择第一个元素。

onChange

value 搭配使用,当选中的值发生改变会触发回调。 function onChange: (value, item) => void

其他

由于 onTouchStartonTouchMove 会和页面的下拉刷新等其他监听事件冲突,而引起某些低端手机的用户体验不友好,所以换成 onScroll 实现。

react-scroll-picker's People

Contributors

liapig avatar

Stargazers

 avatar

Watchers

 avatar  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.