Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

微信刚出的bind:chooseavatar事件用Rax如何写事件名? #2397

Open
dong-lufei opened this issue Nov 18, 2022 · 1 comment
Open

Comments

@dong-lufei
Copy link

用onChooseavatar写事件好像失效。

需要支持微信小程序 open-type 头像获取:https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/userProfile.html
支持chooseAvatar回调

@fengyepiaoling
Copy link

rax官方未更新,我是用下面的方法临时解决的。
手动在小程序编译后文件(build/wechat-miniprogram)根目录 render.js\root.wxml 这两个文件添加以下代码。
root.wxml 文件里搜索 onButton,找到对应 DOM 添加如下属性
bindchooseavatar="onButtonChooseAvatar"
render.js 文件里搜索 onButton,找到对应数组里添加以下对象
{
name: 'onButtonChooseAvatar',
eventName: 'chooseAvatar'
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants