微信小程序弹框wx.showModal如何修改样式
由于官方API提供的显示模态弹窗,只能简单地显示文字内容,不能对对话框内容进行自定义,欠缺灵活性,所以自己从模态弹窗的原理角度来实现了自定义的模态对话框。 wx.showModal修改样式后的效果,如下图所示: index.wxml代码: <!--index.wxml--> < button class= "show-btn" bindtap= "showDialogBtn">弹窗 </ button> <!--弹窗--> < view class= "modal-mask" bindtap= "hideModal" catchtouchmove= "preventTouchMove" wx:if= "{{showModal}}"> </ view> < view class= "modal-dialog" wx:if= "{{showModal}}"> < view class= "modal-title">添加数量 </ view> < view class= "modal-content"> < view class= "modal-input"> < input placeholder-class= "input-holder" type= "number" maxlength= "10" bindinput= "inputChange" class= "input"