本文主要为大家详细介绍了微信小程序实现mui数字输入框效果,我们会以代码的示例来教大家,希望大家能根据这个实现思路来完成自己的mui数字输入框效果。
WXML
<view> <view>默认</view> <view> <view> <button>-</button> <input> <button>+</button> </view> </view> <view>限定最小值0,最大值10</view> <view> <view> <button>-</button> <input> <button>+</button> </view> </view></view>
WXSS
.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
Page({
data: {
number: 1,
number1: 5,
disabled1: false,
disabled2: false
},
prevNum(){
this.setData({ number: this.data.number + 1 });
},
nextNum(){
this.setData({ number: this.data.number - 1 });
},
prevNum1() {
this.setData({
number1: this.data.number1 >= 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 <p><strong>注意</strong></p><p>button组件的边框和圆角设置在button::after,需要对其重置。<br></p><div class="aritcle_card flexRow artxards">
<div class="artcardd flexRow">
<a class="aritcle_card_img" rel="nofollow" href="/xiazai/code/11411" title="小程序管理平台系统源码"><img
src="https://img.php.cn/upload/webcode/000/000/000/6a5440c80e261283.png" alt="小程序管理平台系统源码" onerror="this.onerror='';this.src='/static/lhimages/moren/morentu.png'" ></a>
<div class="aritcle_card_info flexColumn">
<a rel="nofollow" href="/xiazai/code/11411" title="小程序管理平台系统源码" class="overflowclass">小程序管理平台系统源码</a>
<p class="overflowclass">小程序管理平台系统源码是一套面向小程序服务商的一站式管理程序,基于 uniapp + ThinkPHP(PHP)开发,支持微信小程序、微信公众号与 H5 端。系统主打"全开源、独立部署、无限开 SAAS 账号",适合需要集中管理多个小程序、为客户代开通与授权的小程序服务商使用。</p>
</div>
<a rel="nofollow" href="/xiazai/code/11411" title="小程序管理平台系统源码" class="aritcle_card_btn flexRow flexcenter"><b></b><span>下载</span>
</a>
</div>
</div><p>相关推荐:<br></p><p><a href="http://www.php.cn/js-tutorial-25455.html" target="_self">javascript实现仿银行密码输入框效果的代码_javascript技巧</a></p><p><a href="http://www.php.cn/js-tutorial-25290.html" target="_self">js实现双击单元格变成文本输入框效果代码_javascript技巧</a></p><p><a href="http://www.php.cn/js-tutorial-386107.html" target="_self">javascript代码实现input输入框模糊提示功能</a></p>










