unipapp 苹果输入法会导致拼音会占位置,无法一次性输入四个字

 

<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);
                    })
                }
            }
        },

 

posted @ 2022-11-29 14:37  小小强学习网  阅读(196)  评论(0编辑  收藏  举报