由于项目中picker的使用场景还挺多,特在此总结一下用法
html
<mpvue-picker ref="mpvuePicker" :pickerValueDefault="pickerValueDefault" @onConfirm="pickerConfirm"
:pickerValueArray="pickerValueArray">
</mpvue-picker>
js
data() {
return {
// picker默认值
pickerValueDefault: [0],
// picker数据
pickerValueArray: []
}
},
// 转单,显示picker
documentTransfer() {
this.$refs.mpvuePicker.show();
},
// 转单picker 确认
pickerConfirm(val) {
// 根据val,做对应的操作
},