微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

微信小程序实现MUI数字输入框效果

本文实例为大家分享微信小程序实现MUI数字输入框的具体代码,供大家参考,具体内容如下

效果

数字输入框效果图

WXML

rush:xml;"> gallery-list"> gallery-list">

WXSS

rush:css;"> .tui-number-group{ display: table; table-layout: fixed; width: 300rpx; text-align: center; border-radius: 6px; border: 1px solid #bbb; overflow: hidden; } .tui-number-cell{ display: table-cell; line-height: 1.7; border-radius: 0; } button::after{ border-bottom: none; border-top: none; border-radius: 0; }

JS

= 10 ? 10 : this.data.number1 + 1,disabled1: this.data.number1 !== 0 ? false : true,disabled2: this.data.number1 !== 10 ? false : true }); },nextNum1() { this.setData({ number1: this.data.number1 <= 0 ? 0 : this.data.number1 - 1,disabled2: this.data.number1 !== 10 ? false : true }); } })

注意

button组件的边框和圆角设置在button::after,需要对其重置。

DEMO

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持编程之家。

原文地址:https://www.jb51.cc/weapp/33922.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。