补充:我把css中的【.contact-btn】注释掉就好了,这个太扯了。。。
getUserInfo响应了contact按钮的事件<button wx:if="{{!hasWxUserInfo && canIUse}}" open-type="getUserInfo" bindgetuserinfo="getWxUserInfo">获取头像昵称</button> <button open-type='contact' class='contact-btn'> <image src='/image/contact.png' class='contact-img' mode='widthFix' /> </button> 以上2个button在同一个页面,点击【获取头像昵称】时,响应了contact事件,请官方同学验证下,谢谢!
2018-06-26我也有同样的问题,定位不精确,我的场景是一个scrollView中有N个view,每个view的height都是100hv,然后在每个view的滑动事件中判断上滑下滑来切换具体显示哪个view,然而scroll-into-view的效果基本没有,有官方的同学指导下吗
scroll-into-viewscroll-into-view 不能滚动到对应的内容区域
2018-06-02该问题已曲线解决,谢谢各位
模板is中的Mustache语法能改成函数吗?我定义了textTmpl、numberTmpl、radioTmpl、checkboxTmpl共4个template,根据item.type来匹配模板的name,目前按【方式1】写是可以正常渲染,但是按【方式2】无法正常渲染 方式1: <block wx:for="{{questions}}" wx:key="id"> <template is="{{item.type == 'TEXT' ? 'textTmpl' : ( item.type == 'NUMBER' ? 'numberTmpl' : ( item.type == 'RADIO' ? 'radioTmpl' : (item.type == 'CHECKBOX' ? 'checkboxTmpl' : 'default')))}}" data="{{...item}}" /> </block> 方式2: <block wx:for="{{questions}}" wx:key="id"> <template is="{{getIs(item)}}" data="{{...item}}" /> </block> page中定义了函数getIs,虽然是照搬,但实际的判断逻辑不止根据item.type匹配,还会有别的字段校验逻辑 getIs:function(item){ console.log(item.type) return item.type == 'TEXT' ? 'textTmpl' : (item.type == 'NUMBER' ? 'numberTmpl' : (item.type == 'RADIO' ? 'radioTmpl' : (item.type == 'CHECKBOX' ? 'checkboxTmpl' : 'default'))) } 微信开发工具的报错信息:Template "undefined" not found.
2018-05-30