关于open-type=“getuserinfo”时按钮怎么绑定事件?

发布于 8 年前作者 gliu10955 次浏览最后编辑 8 年前来自 ask

怎么才能在open-type=“getuserinfo”时绑定按钮事件?

源代码:

已经有一个bind事件了,难不成还要再来一个bind事件

<button wx:if="{{!hasUserInfo && canIUse}}" open-type="getUserInfo" bindgetuserinfo="getuserinfo">点击登录</button>
2 回复
yan97
yan971 楼5 年前
<button bindtap="按钮事件" wx:if="{{!hasUserInfo && canIUse}}" open-type="getUserInfo">点击登录</button>

linli
linli2 楼5 年前

你的需求是什么?没太懂,点击按钮事件回调?bindgetuserinfo 不就是用户点击按钮吗?