最近在開發(fā)中遇到的一些坑點(diǎn)
阻止input冒泡 上例中input操作會冒泡到container,導(dǎo)致
修正 冒泡的問題是由input的tap事件導(dǎo)致,因此定義一個empty的空方法,使它響應(yīng)input的catch:tap,來達(dá)到阻止input的冒泡的作用 在容器(fixed)中的input如何彈出鍵盤 container組件在屏幕底部出現(xiàn),點(diǎn)擊Input組件時,彈出的鍵盤會遮蓋input輸入框 修正
Page({data: {mystyle: '',},onkeybord(e){let detail = e.detaillet kbHeight = detail.heightlet tool = Pager.getElementsById('reminder-tool')if (kbHeight === 0) {this.setData({mystyle: ' ' })}if (kbHeight && kbHeight > 0) {this.setData({mystyle: `bottom: ${kbHeight-40}px;` })}}}) |
微信小程序input怎么禁止輸入漢字
發(fā)布時間:2020-10-30 瀏覽:3188