微信小程序中的表单输入组件默认上推页面,不符合某些需求,下面是一个解决方案。
- 设置表单组件的默认上推页面属性
adjust-position=“{{false}}”
- 表单组件绑定
focus
事件
1 | <input bindfocus="focushandler"></input> |
1 | focushandler(e){ |
输入区域绝对定位
1 | <input bindfocus="focushandler" style="{{bottom?'position:absolute;bottom:'+bottom+'px;':''}}"></input> |