Coder Social home page Coder Social logo

taro-slider's Introduction

taro-slider

基于taro开发的双向滑动slider,可用于区间选择。



引入

import IntervalSlider from '../../components/intervalSlider'

使用

无标记的

<IntervalSlider
  maxValue={87}
  minValue={0}
  max={200}
  selectedColor='red'
  onChange={this.onChange.bind(this)}
/>

有标记的

<IntervalSlider
  marksArr={marksArr}
  maxValue={87}
  minValue={0}
  max={200}
  selectedColor='green'
  onChange={this.onChange.bind(this)}
/>

// marksArr 结构
[{
  position: 0, // 位置信息,取值范围0-100
  label: '0元' // 标记显示的文本
}, {
  position: 25,
  label: '250元'
}, {
  position: 50,
  label: '500元'
}, {
  position: 75,
  label: '750元'
}, {
  position: 100,
  label: '1000元'
}]

参数说明

min: Number 最小值
max: Number 最大值
minValue: Number 当前最小值
maxValue: Number 当前最大值
bgColor: String 背景色
selectedColor: String 选中色
marksArr: Array 标记列表,不传此参则是普通的slider,该参数用来实现标记效果

taro-slider's People

Contributors

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