Browse Source

获取数据input

luolei 5 years ago
parent
commit
cab6446232
3 changed files with 12 additions and 8 deletions
  1. 2 2
      src/common/ComTextArea.vue
  2. 6 5
      src/common/MultiLineInput.vue
  3. 4 1
      src/components/AddContent.vue

+ 2 - 2
src/common/ComTextArea.vue

@@ -34,14 +34,14 @@ export default {
   methods:{
     changeVal(){
       this.$emit('changeAreaVal',this.txt)
+      const newData = Object.assign({},this.item,{value:this.txt,valueP:this.txt});
+      this.$emit("updata",newData);
     },
     blur(){
       document.activeElement.scrollIntoViewIfNeeded(true);
       setTimeout(()=>{
         document.activeElement.scrollIntoViewIfNeeded(true);
       },300)
-      const newData = Object.assign({},this.item,{value:this.txt,valueP:this.txt});
-      this.$emit("updata",newData);
     }
   },
   watch:{

+ 6 - 5
src/common/MultiLineInput.vue

@@ -75,6 +75,12 @@ export default {
       this.txt = tmpTxt
       this.content = getModelExpStr(this.msg,this.txt)
       // this.$emit('changeMultipVal',e.currentTarget.value,num)
+      
+      const select = this.part.select;
+      // if(!select){return}
+      const newData = Object.assign({},this.part,{value:this.txt,controlType:3,valueP:this.txt});
+      this.$emit("updata",newData);
+      this.$emit('handleInp',this.txt);
     },
     blur(){
       // 如果该项未选中,则不存值           
@@ -82,11 +88,6 @@ export default {
       setTimeout(()=>{
         document.activeElement.scrollIntoViewIfNeeded(true);
       },300)
-      const select = this.part.select;
-      // if(!select){return}
-      const newData = Object.assign({},this.part,{value:this.txt,controlType:3,valueP:this.txt});
-      this.$emit("updata",newData);
-      this.$emit('handleInp',this.txt);
     },
     handleClick(e){
       // 点击输入框时不选中该项

+ 4 - 1
src/components/AddContent.vue

@@ -78,9 +78,12 @@ export default {
   },
   mounted() {
     this.$nextTick(()=>{
+      
+    })
+    setTimeout(() => {
       let scroll = setScroll(BScroll,true,'.addper')
       this.scroll = scroll
-    })
+    }, 500);
   },
   methods: {
     back() {