- 发布:2020-09-01 15:24
- 更新:2020-09-01 20:55
- 阅读:841
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: win10
HBuilderX类型: 正式
HBuilderX版本号: 2.8.8
手机系统: 全部
页面类型: vue
打包方式: 云端
项目创建方式: HBuilderX
测试过的手机:
示例代码:
<view class="uni-list">
<view class="uni-list-cell">
<view class="uni-list-cell-left">
当前选择
</view>
<view class="uni-list-cell-db">
<picker @change="bindPickerChange" :value="index" :range="array" range-key="name">
<view class="uni-input">{{array[index].name}}</view>
</picker>
</view>
</view>
</view>
array: [{name:'中国'},{name: '美国'}, {name:'巴西'}, {name:'日本'}],
bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为:' + e.detail.value)
this.index = e.detail.value
},
<view class="uni-list">
<view class="uni-list-cell">
<view class="uni-list-cell-left">
当前选择
</view>
<view class="uni-list-cell-db">
<picker @change="bindPickerChange" :value="index" :range="array" range-key="name">
<view class="uni-input">{{array[index].name}}</view>
</picker>
</view>
</view>
</view>
array: [{name:'中国'},{name: '美国'}, {name:'巴西'}, {name:'日本'}],
bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为:' + e.detail.value)
this.index = e.detail.value
},
操作步骤:
。。。
。。。
预期结果:
。。。
。。。
实际结果:
。。。
。。。
bug描述:
APP第一次进入页面时picker 弹出选择后可以赋值,再次进入页面picker 组件点击弹出选择后无法赋值
1 个回复
DCloud_UNI_HT
提供完整的代码片段或者上传简单demo