<view class="form-wrap"> <text class="label">供应商简称</text> <input type="text" class="uni-input" placeholder="请输入简称最多4个字符" @input="checkdata(infoData.site_short_name)" v-model="infoData.site_short_name"/> </view>
checkdata(e){ if(e.length>4){ _this.$nextTick(() => { _this.infoData.site_short_name = e.substr(0,4) }) } }, fixprice(e){ var that=this; let arr = String(e).split("."); if(arr.length>1){ var len = arr[1].length; if(len>2){ that.$nextTick(() => { that.user.price =parseFloat(e).toFixed(2); }) } } },
标签:nextTick,输入法,拼音,arr,length,unipapp,var From: https://www.cnblogs.com/xqschool/p/16935346.html