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

View File

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