|
@@ -1,12 +1,11 @@
|
|
|
<template>
|
|
|
- <div class="comArea" :style="getStyle(detail,slide)" @touchmove.prevent>
|
|
|
+ <div class="comArea" @touchmove.prevent>
|
|
|
<textarea
|
|
|
:style="{width:width,height:height}"
|
|
|
v-model="txt"
|
|
|
placeholder="请输入"
|
|
|
- @focus="focus"
|
|
|
- @blur="blur"></textarea>
|
|
|
- <div class="realSure sure" @click="makeSuer">
|
|
|
+ @input="changeVal"></textarea>
|
|
|
+ <div :class="sure?'realSure sure':'sure'" @click="makeSuer">
|
|
|
确定
|
|
|
</div>
|
|
|
</div>
|
|
@@ -29,48 +28,29 @@ export default {
|
|
|
default: '2rem',
|
|
|
type: String
|
|
|
},
|
|
|
- slide:{
|
|
|
- default:false,
|
|
|
- type:Boolean
|
|
|
- },
|
|
|
- detail:{
|
|
|
- default:2,
|
|
|
- type:Number||String
|
|
|
+ item:{
|
|
|
+ default:{}
|
|
|
}
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- txt: '', //回读用
|
|
|
+ txt: this.item.value||'', //回读用
|
|
|
sure:false,
|
|
|
// txt:''
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
|
- getStyle(detail,slide){
|
|
|
- if(detail == 1){
|
|
|
- if(slide){
|
|
|
- return {'display':'block','background-color': '#F9F9F9'}
|
|
|
- }else{
|
|
|
- return {'display':'none'}
|
|
|
- }
|
|
|
+ changeVal(e){
|
|
|
+ this.txt = e.target.value;
|
|
|
+ const notNull=this.txt.match(/\S/g);
|
|
|
+ if(notNull){
|
|
|
+ this.sure=true;
|
|
|
}else{
|
|
|
- return {'display':'block'}
|
|
|
- }
|
|
|
- },
|
|
|
- blur(){
|
|
|
- setTimeout(()=>{
|
|
|
- $(".foot").css({'display':'block'})
|
|
|
- },150)
|
|
|
- },
|
|
|
- focus(){
|
|
|
- if(isIos()){
|
|
|
- setTimeout(() => {
|
|
|
- $(".foot").css({'display':'none'})
|
|
|
- }, 150);
|
|
|
+ this.sure=false;
|
|
|
}
|
|
|
},
|
|
|
makeSuer(){
|
|
|
- //if(!this.sure){return}
|
|
|
+ if(!this.sure){return}
|
|
|
let n = this.num;
|
|
|
this.$emit("updata",'',{val:this.txt||'无',valp:this.txt||'无'},++n);
|
|
|
}
|