From 6df0d4badeff1464a66bf4589cd04c127c4c7dbd Mon Sep 17 00:00:00 2001 From: neverland Date: Fri, 21 Sep 2018 10:17:31 +0800 Subject: [PATCH] [bugfix] Toast: method warning when touchmove (#618) --- packages/overlay/index.js | 5 ++++- packages/overlay/index.wxml | 2 +- packages/toast/index.js | 5 ++++- packages/toast/index.wxml | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/overlay/index.js b/packages/overlay/index.js index 68b3b4fe..794cf1e4 100644 --- a/packages/overlay/index.js +++ b/packages/overlay/index.js @@ -14,6 +14,9 @@ create({ methods: { onClick() { this.$emit('click'); - } + }, + + // for prevent touchmove + noop() {} } }); diff --git a/packages/overlay/index.wxml b/packages/overlay/index.wxml index 906fda2a..630afac6 100644 --- a/packages/overlay/index.wxml +++ b/packages/overlay/index.wxml @@ -3,5 +3,5 @@ custom-class="van-overlay" custom-style="z-index: {{ zIndex }}; {{ mask ? 'background-color: rgba(0, 0, 0, .7);' : '' }}; {{ customStyle }}" bind:tap="onClick" - catch:touchmove + catch:touchmove="noop" /> diff --git a/packages/toast/index.js b/packages/toast/index.js index ca772164..9c0d9e89 100644 --- a/packages/toast/index.js +++ b/packages/toast/index.js @@ -29,6 +29,9 @@ create({ this.setData({ show: false }); - } + }, + + // for prevent touchmove + noop() {} } }); diff --git a/packages/toast/index.wxml b/packages/toast/index.wxml index 5df591d8..5b1e9a6f 100644 --- a/packages/toast/index.wxml +++ b/packages/toast/index.wxml @@ -10,7 +10,7 @@ > {{ message }}