1
0
mirror of https://gitee.com/vant-contrib/vant-weapp.git synced 2025-04-06 03:58:05 +08:00

feat(Button): add chooseavatar event ()

This commit is contained in:
MyHdg 2022-07-23 22:36:33 +08:00 committed by GitHub
parent 878814c98f
commit 6997c225a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions
packages

@ -25,6 +25,7 @@
binderror="onError" binderror="onError"
bindlaunchapp="onLaunchApp" bindlaunchapp="onLaunchApp"
bindopensetting="onOpenSetting" bindopensetting="onOpenSetting"
bindchooseavatar="onChooseAvatar"
> >
<block wx:if="{{ loading }}"> <block wx:if="{{ loading }}">
<van-loading <van-loading

@ -46,5 +46,13 @@ export const button = Behavior({
onOpenSetting(event: WechatMiniprogram.ButtonOpenSetting) { onOpenSetting(event: WechatMiniprogram.ButtonOpenSetting) {
this.triggerEvent('opensetting', event.detail); this.triggerEvent('opensetting', event.detail);
}, },
onChooseAvatar(
event: WechatMiniprogram.CustomEvent<
WechatMiniprogram.GeneralCallbackResult & { avatarUrl: string }
>
) {
this.triggerEvent('chooseavatar', event.detail);
},
}, },
}); });