使用button设置:
open-type="chooseAvatar":来获取用户的微信头像;
chooseavatar:来获取微信的头像事件;
html:
<button open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
</button>
js:
onChooseAvatar(e) {
console.log(e.detail.avatarUrl);
}
使用button设置:
open-type="chooseAvatar":来获取用户的微信头像;
chooseavatar:来获取微信的头像事件;
html:
<button open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
</button>
js:
onChooseAvatar(e) {
console.log(e.detail.avatarUrl);
}