Skip to content

Commit 177c726

Browse files
author
xuqingkai
committed
feat: ✨ Button 支持微信小程序chooseavatar和agreeprivacyauthorization事件
1 parent e8b5c1a commit 177c726

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

src/uni_modules/wot-design-uni/components/wd-button/wd-button.vue

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
@error="handleError"
3434
@launchapp="handleLaunchapp"
3535
@opensetting="handleOpensetting"
36+
@chooseavatar="handleChooseavatar"
37+
@agreeprivacyauthorization="handleAgreePrivacyAuthorization"
3638
>
3739
<view v-if="loading" class="wd-button__loading">
3840
<view class="wd-button__loading-svg" :style="loadingStyle"></view>
@@ -123,7 +125,17 @@ const loadingStyle = computed(() => {
123125
return `background-image: url(${loadingIconSvg.value});`
124126
})
125127
126-
const emit = defineEmits(['click', 'getuserinfo', 'contact', 'getphonenumber', 'error', 'launchapp', 'opensetting'])
128+
const emit = defineEmits([
129+
'click',
130+
'getuserinfo',
131+
'contact',
132+
'getphonenumber',
133+
'error',
134+
'launchapp',
135+
'opensetting',
136+
'chooseavatar',
137+
'agreeprivacyauthorization'
138+
])
127139
128140
function handleClick(event) {
129141
if (!props.disabled && !props.loading) {
@@ -154,6 +166,14 @@ function handleLaunchapp(event) {
154166
function handleOpensetting(event) {
155167
emit('opensetting', event.detail)
156168
}
169+
170+
function handleChooseavatar(event) {
171+
emit('chooseavatar', event.detail)
172+
}
173+
174+
function handleAgreePrivacyAuthorization(event) {
175+
emit('agreeprivacyauthorization', event.detail)
176+
}
157177
function buildLoadingSvg() {
158178
const { loadingColor, type, plain } = props
159179
let color = loadingColor

0 commit comments

Comments
 (0)