0.4.2 β€’ Published 3 years ago

vue-smooth-picker v0.4.2

Weekly downloads
1,135
License
MIT
Repository
github
Last release
3 years ago

vue-smooth-picker Version Badge

πŸ„πŸΌ A VueSmoothPicker for Vue 2 & 3

travis build NPM downloads JS gzip size CSS gzip size

NPM Description

Let's more easily select specific data on the touch screen devices, let's go!

Take a look

Screen shot

Screen record

Install

npm i -S vue-smooth-picker@^0.4.0  # for Vue 2

npm i -S vue-smooth-picker@^1.0.0-alpha  # for Vue 3

Usage

English usage docs

中文使用文摣

Quick look

// import and use
import 'vue-smooth-picker/dist/css/style.css'
import VueSmoothPicker from 'vue-smooth-picker'
// app is your application instance created by `createApp`
app.use(VueSmoothPicker)
...
// in your template
<VueSmoothPicker ref="smoothPicker" :data="data" @change="change" />

Or see: example files

Event

nametypedefaultexplain
changeFunction({ gIndex, iIndex }) => {}Callback after data current index changed, pass one object, which has two keys, group index gIndex and item index iIndex

Props

nametypedefaultexplain
dataArray[]VueSmoothPicker initial data
data[i].currentIndexNumber0Current index of this group's list
data[i].flexNumber1Group weights in parent width 1..12
data[i].listArray-List of the group
data[i].list[j]String or Object-Item in the list of group, use value key when it is a object item
data[i].onClickFunction-Click event on the middle layer of this group, pass two arguments, this group index gIndex and selected index iIndex of this group
data[i].textAlignString-left center or right in item block
data[i].classNameString-Your custom class name for this group
data[i].dividerBooleanfalseIf it is true, then onClick list currentIndex will be not used
data[i].textString-Just used when divider is true

Methods

nametypeexplain
setGroupDataFunction => voidDynamically set a group data with two arguments (gIndex, gData), group index and group data (see props data[i])
getCurrentIndexListFunction => []Return a Array of the groups current index list (has divider current index, and it is default to 0)
getGroupsRectListFunction => voidGet some info for gesture, you can call this function when the component displayed if the component is hidden when it's initialization

Any problem?

Please let me know.

Donate

Become a sponser

🌚 A github star ⍟

License

MIT

1.0.0-alpha.5

3 years ago

1.0.0-alpha.4

3 years ago

1.0.0-alpha.3

3 years ago

1.0.0-alpha.2

3 years ago

1.0.0-alpha.1

3 years ago

1.0.0-alpha

4 years ago

0.4.2

6 years ago

0.4.1

6 years ago

0.4.0

6 years ago

0.3.9

6 years ago

0.3.8

7 years ago

0.3.7

7 years ago

0.3.6

7 years ago

0.3.5

7 years ago

0.3.3

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.7

7 years ago

0.2.6

7 years ago

0.2.5

8 years ago

0.2.4

8 years ago

0.2.3

8 years ago

0.2.2

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.12

8 years ago

0.1.11

8 years ago

0.1.10

8 years ago

0.1.9

8 years ago

0.1.8

8 years ago

0.1.7

8 years ago

0.1.6

8 years ago

0.1.5

8 years ago

0.1.3

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago