[bugfix] Picker should prevent default touchmove (#432)

This commit is contained in:
neverland 2017-12-14 11:05:44 +08:00 committed by GitHub
parent 1d105afc70
commit f0143636db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -109,7 +109,7 @@ export default create({
frameStyle() {
return {
height: this.itemHeight + 'px'
}
};
},
currentValue() {
@ -168,7 +168,7 @@ export default create({
},
setValue(value) {
const { options, valueKey } = this;
const { options } = this;
for (let i = 0; i < options.length; i++) {
if (this.getOptionText(options[i]) === value) {
this.setIndex(i);

View File

@ -7,7 +7,7 @@
<div class="van-picker__title" v-if="title" v-text="title" />
</slot>
</div>
<div class="van-picker__columns">
<div class="van-picker__columns" @touchmove.prevent>
<picker-column
v-for="(item, index) in currentColumns"
:key="index"
@ -47,7 +47,7 @@ export default create({
columns: {
type: Array,
default: () => []
},
}
},
data() {
@ -64,7 +64,7 @@ export default create({
watch: {
columns() {
this.initColumns();
},
}
},
methods: {