mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
[bugfix] Button: tap triggered twice
This commit is contained in:
parent
7529373a7c
commit
67862f03dc
@ -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"
|
||||
|
@ -36,7 +36,6 @@ Component({
|
||||
|
||||
methods: {
|
||||
onTap() {
|
||||
this.triggerEvent('tap');
|
||||
const { url } = this.data;
|
||||
if (url) {
|
||||
wx[this.data.linkType]({ url });
|
||||
|
@ -12,7 +12,7 @@ Component({
|
||||
},
|
||||
|
||||
methods: {
|
||||
onClick() {
|
||||
onTap() {
|
||||
if (!this.data.disabled && !this.data.loading) {
|
||||
const checked = !this.data.checked;
|
||||
this.triggerEvent('input', checked);
|
||||
|
@ -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" />
|
||||
|
Loading…
x
Reference in New Issue
Block a user