> 选择器(相当于web的下拉框)在表单功能模块中是十分常用的组建,以下代码来自hello uniapp供大家参考
> 官方文档:https://uniapp.dcloud.io/component/picker
[TOC]
## 普通选择器
~~~
普通选择器
{ {array[index].name}}
export default {
data() {
return {
array: [{name:'中国'},{name: '美国'}, {name:'巴西'}, {name:'日本'}],
index: 0
}
},
methods: {
bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为:' + e.detail.value)
this.index = e.detail.value
}
}
}
~~~
## 时间选择器
~~~
时间选择器
{ {time}}
export default {
data() {
return {
time: '12:01'
}
},
methods: {
b