[bugfix] Button: tap triggered twice

This commit is contained in:
陈嘉涵 2018-08-03 11:47:59 +08:00
parent 7529373a7c
commit 67862f03dc
4 changed files with 3 additions and 4 deletions

View File

@ -13,7 +13,7 @@
send-message-path="{{ sendMessagePath }}"
send-message-img="{{ sendMessageImg }}"
show-message-card="{{ showMessageCard }}"
bindtap="onTap"
catch:tap="onTap"
bindcontact="bindcontact"
bindgetuserinfo="bindgetuserinfo"
bindgetphonenumber="bindgetphonenumber"

View File

@ -36,7 +36,6 @@ Component({
methods: {
onTap() {
this.triggerEvent('tap');
const { url } = this.data;
if (url) {
wx[this.data.linkType]({ url });

View File

@ -12,7 +12,7 @@ Component({
},
methods: {
onClick() {
onTap() {
if (!this.data.disabled && !this.data.loading) {
const checked = !this.data.checked;
this.triggerEvent('input', checked);

View File

@ -1,7 +1,7 @@
<view
class="van-switch custom-class {{ checked ? 'van-switch--on' : '' }} {{ disabled ? 'van-switch--disabled' : '' }}"
style="font-size: {{ size }};"
bind:tap="onClick"
bind:tap="onTap"
>
<view class="van-switch__node node-class">
<van-loading wx:if="{{ loading }}" size="50%" custom-class="van-switch__loading" />