vue-mobile-picker is a picker for picker in vue,You can easily use this component.
npm install vue-mobile-picker -S
npm install better-picker --save-dev
You can import the whole package or each module individual.
import VueMobilePicker from 'vue-mobile-picker'
Vue.use(VueMobilePicker)
create one you component
<picker :datas="datas" :title="title" @child-info="get"></picker>
this data of datas and title just like this:
Name | Type | Necessary | Desc |
---|---|---|---|
datas | Array | Yes | It's a two dimensional |
title | String | No | this picker's title |
datas:[
[
{
text: '小美',
value: 1
},
{
text: '猪猪',
value: 2
}
],
[
{
text: '张三',
value: 1
},
{
text: '李四',
value: 2
},
{
text: '王五',
value: 3
},
{
text: '赵六',
value: 4
},
{
text: '吴七',
value: 5
},
{
text: '陈八',
value: 6
},
{
text: '杜九',
value: 7
},
{
text: '黄十',
value: 8
},
{
text: '呵呵',
value: 9
},
{
text: '哈哈',
value: 10
},
{
text: '嘿嘿',
value: 11
},
{
text: '啦啦',
value: 12
}
],
[
{
text: '开心',
value: 1
}, {
text: '生气',
value: 2
},
{
text: '搞笑',
value: 3
}, {
text: '难过',
value: 4
}
]
],
-
just call this method named get:
get(choiceData){ console.log(choiceData) }
- npm install
- npm run dev