Browse Source

正则修改

luolei 5 years ago
parent
commit
fe0c9d0340
3 changed files with 3 additions and 3 deletions
  1. 1 1
      src/common/Input.vue
  2. 1 1
      src/common/MultiLineInput.vue
  3. 1 1
      src/common/OptionInp.vue

+ 1 - 1
src/common/Input.vue

@@ -26,7 +26,7 @@
       changeVal(e){
         this.borColor = true;
         if(this.item.controlType==7){//数字键盘
-          this.val = e.target.value=e.target.value.replace(/^\.|\.$/,'')
+          this.val = e.target.value=e.target.value.replace(/^\.$/,'')
         }
         // document.activeElement.scrollIntoViewIfNeeded(true);
         this.borColor = false;

+ 1 - 1
src/common/MultiLineInput.vue

@@ -74,7 +74,7 @@ export default {
       let tmpTxt = '',arr=this.tmpArr
       document.activeElement.scrollIntoViewIfNeeded(true);
       if(type == 'number'){
-        e.currentTarget.value = e.currentTarget.value.replace(/^\.|\.$/,'')
+        e.currentTarget.value = e.currentTarget.value.replace(/^\.$/,'')
       }
       arr[num]=e.currentTarget.value
       tmpTxt=arr.join('/')

+ 1 - 1
src/common/OptionInp.vue

@@ -39,7 +39,7 @@ import $ from 'jquery';
     methods:{
       changeVal(e){
         if(this.msg.type=='number'){//数字键盘
-          this.txt = e.target.value=e.target.value.replace(/^\.|\.$/,'')
+          this.txt = e.target.value=e.target.value.replace(/^\.$/,'')
         }
         
         const newData = Object.assign({},this.part,{value:this.txt});