<button class="avatar-wrapper" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
<image class="avatar" :src="avatarUrl"></image>
</button>
<input type="nickname" class="weui-input" @change="getNickname" placeholder="请输入昵称" />
getNickname(e) {
console.log("getNickname", e.detail.value)
},
onChooseAvatar(e) {
console.log(e, '头像昵称')
const {
avatarUrl
} = e.detail
this.avatarUrl = avatarUrl
},
参考文档:https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/userProfile.html
标签:console,avatarUrl,微信,detail,昵称,头像,getNickname From: https://www.cnblogs.com/sishe/p/17745537.html