提交 6e38e08c 编写于 作者: 郭胜强

fix: 解决picker显示的选中项不正确的问题 #103

上级 05167597
......@@ -40,8 +40,11 @@ export default {
methods: {
// 处理 Picker close 回调
_onPickerClose () {
// 隐藏 picker
// 隐藏 picker 重置数据
this.showPicker.visible = false
this.showPicker.mode = 'selector'
this.showPicker.range = []
this.showPicker.value = 0
}
}
}
<template>
<uni-picker @touchmove.prevent>
<transition name="uni-fade">
<div
v-show="visible"
class="uni-mask"
<div
v-show="visible"
class="uni-mask"
@click="_cancel" />
</transition>
<div
:class="{'uni-picker_toggle':visible}"
<div
:class="{'uni-picker-toggle':visible}"
class="uni-picker">
<div
class="uni-picker-header"
<div
class="uni-picker-header"
@click.stop>
<div
class="uni-picker-action uni-picker-action-cancel"
<div
class="uni-picker-action uni-picker-action-cancel"
@click="_cancel">取消</div>
<div
class="uni-picker-action uni-picker-action-confirm"
<div
class="uni-picker-action uni-picker-action-confirm"
@click="_change">确定</div>
</div>
<v-uni-picker-view
:value.sync="valueArray"
<v-uni-picker-view
v-if="visible"
:value.sync="valueArray"
class="uni-picker-content">
<v-uni-picker-view-column
v-for="(range,index0) in rangeArray"
<v-uni-picker-view-column
v-for="(range,index0) in rangeArray"
:key="index0">
<div
v-for="(item,index) in range"
:key="index"
<div
v-for="(item,index) in range"
:key="index"
class="uni-picker-item">{{ typeof item==='object'?item[rangeKey]||'':item }}{{ units[index0]||'' }}</div>
</v-uni-picker-view-column>
</v-uni-picker-view>
......@@ -351,7 +352,7 @@ export default {
transition: transform 0.3s;
}
uni-picker .uni-picker.uni-picker_toggle {
uni-picker .uni-picker.uni-picker-toggle {
transform: translate(0, 0);
}
......@@ -457,4 +458,4 @@ export default {
text-align: center;
transform: translateX(2em);
} */
</style>
</style>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册