zhouna 5 лет назад
Родитель
Сommit
8bbcdcc644
1 измененных файлов с 6 добавлено и 0 удалено
  1. 6 0
      src/common/OptionInp.vue

+ 6 - 0
src/common/OptionInp.vue

@@ -8,6 +8,7 @@
             :class="[{'cancel':item.select==0}]"
             v-model="txt"
            @click="handleCli"
+           @input="changeVal"
             @blur="handleBlur">
     <span class="suffix" v-if="msg.suffix">{{msg.suffix}}</span>
   </div>
@@ -32,6 +33,11 @@ import $ from 'jquery';
       this.select = this.item.select;
     },
     methods:{
+      changeVal(e){
+        if(this.msg.type=='number'){//数字键盘
+          this.txt = e.target.value=e.target.value.replace(/^\.$/,'')
+        }
+      },
       handleBlur(){
         this.$emit('handleInp',this.txt,this.inx);
         /*setTimeout(()=>{