uniapp中没有bindaddfriend方法,使用条件编译,在真机上还是报错,请问应该如何解决这个问题呢? 急急急
<!-- #ifdef MP-QQ -->
<button
type="primary"
open-type="addFriend"
open-id=""
bindaddfriend="bindaddfriend"
>添加好友</button>
<!-- #endif -->
methods: {
// #ifdef MP-QQ
bindaddfriend(e){
qq.getSetting({
success(res) {
if(!res.authSetting['setting.addFriend']){
qq.authorize({
scope: 'setting.addFriend',
success() {
}
})
}
}
})
},
// #endif
}
真机报错信息: Component "pages/index/index" does not have a method "bindaddfriend" to handle event "addfriend".
1 个回复
DCloud_UNI_WZF
用vue语法绑定事件 @addfriend