uni-app使用getPhoneNumber接口
uni-app按照官方写法 ,始终报错 ,连续踩坑<button open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber"> </button>Component "pages/login/login" does not have a method "getPhoneNumber" to handle...
·
uni-app按照官方写法 ,始终报错 ,连续踩坑
<button open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber"> </button>
Component "pages/login/login" does not have a method "getPhoneNumber" to handle event "getphonenumber".
注意把微信的
bindgetphonenumber="getPhoneNumber"
改为
@getphonenumber="getPhoneNumber"
示例
<button open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" class="login-but">微信登录</button>
获取
methods:{
getPhoneNumber(e){
console.log(e)
},
}
更多推荐
已为社区贡献1条内容
所有评论(0)