uni-app调用微信小程序接口报错Component “pages/login/login“ does not have a method “onChooseAvatar“
项目场景:在uni-app中尝试使用接口获得用户头像 但是出错了问题描述vue中template配置:<button class="avatar-wrapper" open-type="chooseAvatar" bind:chooseavatar="onChooseAvatar"><image class="avatar" src:avatarUrl></image
·
项目场景:
在uni-app中尝试使用接口获得用户头像 但是出错了
问题描述
vue中template配置:
<button class="avatar-wrapper" open-type="chooseAvatar" bind:chooseavatar="onChooseAvatar">
<image class="avatar" src:avatarUrl></image>
</button>
methods配置:
<button class="avatar-wrapper" open-type="chooseAvatar" bind:chooseavatar="onChooseAvatar">
<image class="avatar" src:avatarUrl></image>
</button>
点击按钮报错: Component "pages/login/login" does not have a method "onChooseAvatar" to handle event "chooseavatar"
@Override
public void run() {
bytes = mmInStream.read(buffer);
mHandler.obtainMessage(READ_DATA, bytes, -1, buffer).sendToTarget();
}
解决方案:
将bind:chooseavatar="onChooseAvatar"修改为@chooseavatar="onChooseAvatar"解决
例如:将原 bind:chooseavatar="onChooseAvatar"
语句修改为 @chooseavatar="onChooseAvatar"
问题解决.
更多推荐
已为社区贡献1条内容
所有评论(0)