mirror of
https://gitee.com/wot-design-uni/wot-design-uni.git
synced 2025-12-07 01:28:30 +08:00
feat: ✨ Button 支持微信小程序chooseavatar和agreeprivacyauthorization事件
This commit is contained in:
parent
e8b5c1af51
commit
177c726e0d
@ -33,6 +33,8 @@
|
||||
@error="handleError"
|
||||
@launchapp="handleLaunchapp"
|
||||
@opensetting="handleOpensetting"
|
||||
@chooseavatar="handleChooseavatar"
|
||||
@agreeprivacyauthorization="handleAgreePrivacyAuthorization"
|
||||
>
|
||||
<view v-if="loading" class="wd-button__loading">
|
||||
<view class="wd-button__loading-svg" :style="loadingStyle"></view>
|
||||
@ -123,7 +125,17 @@ const loadingStyle = computed(() => {
|
||||
return `background-image: url(${loadingIconSvg.value});`
|
||||
})
|
||||
|
||||
const emit = defineEmits(['click', 'getuserinfo', 'contact', 'getphonenumber', 'error', 'launchapp', 'opensetting'])
|
||||
const emit = defineEmits([
|
||||
'click',
|
||||
'getuserinfo',
|
||||
'contact',
|
||||
'getphonenumber',
|
||||
'error',
|
||||
'launchapp',
|
||||
'opensetting',
|
||||
'chooseavatar',
|
||||
'agreeprivacyauthorization'
|
||||
])
|
||||
|
||||
function handleClick(event) {
|
||||
if (!props.disabled && !props.loading) {
|
||||
@ -154,6 +166,14 @@ function handleLaunchapp(event) {
|
||||
function handleOpensetting(event) {
|
||||
emit('opensetting', event.detail)
|
||||
}
|
||||
|
||||
function handleChooseavatar(event) {
|
||||
emit('chooseavatar', event.detail)
|
||||
}
|
||||
|
||||
function handleAgreePrivacyAuthorization(event) {
|
||||
emit('agreeprivacyauthorization', event.detail)
|
||||
}
|
||||
function buildLoadingSvg() {
|
||||
const { loadingColor, type, plain } = props
|
||||
let color = loadingColor
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user