|
@@ -6,10 +6,10 @@
|
|
|
:placeholder="msg.placeholder"
|
|
|
:style="{'width':!msg.prefix&&!msg.suffix?'90%':'33%'}"
|
|
|
:class="[{'cancel':item.select==0}]"
|
|
|
- v-model="txt"
|
|
|
+ v-model="txt"
|
|
|
@click="handleCli"
|
|
|
@input="changeVal"
|
|
|
- @blur="handleBlur">
|
|
|
+ >
|
|
|
<span class="suffix" v-if="msg.suffix">{{msg.suffix}}</span>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -22,7 +22,7 @@ import $ from 'jquery';
|
|
|
data(){
|
|
|
return{
|
|
|
msg:{},
|
|
|
- txt:this.item.value || '',
|
|
|
+ txt:this.item.value||'',
|
|
|
select:0,
|
|
|
url:[require('../images/iptselect.png'),require('../images/iptdis.png')]
|
|
|
}
|
|
@@ -34,19 +34,26 @@ import $ from 'jquery';
|
|
|
},
|
|
|
methods:{
|
|
|
changeVal(e){
|
|
|
+ this.txt = e.target.value;
|
|
|
if(this.msg.type=='number'){//数字键盘
|
|
|
this.txt = e.target.value=e.target.value.replace(/^\.$/,'')
|
|
|
}
|
|
|
+ this.$emit('handleInp',this.txt,this.inx);
|
|
|
+ if(this.txt&&!this.item.select||(!this.txt&&this.item.select)){
|
|
|
+ this.$emit("handleSelect")
|
|
|
+ }
|
|
|
},
|
|
|
handleBlur(){
|
|
|
- this.$emit('handleInp',this.txt,this.inx);
|
|
|
+ /* if(this.txt){
|
|
|
+ this.$emit('handleInp',this.txt,this.inx);
|
|
|
+ }*/
|
|
|
/*setTimeout(()=>{
|
|
|
$(".foot").css({'display':'block'})
|
|
|
},150)*/
|
|
|
|
|
|
},
|
|
|
handleCli(e){
|
|
|
- if(this.select){//已选中后点击输入框不取消选中
|
|
|
+ if(this.select||!this.txt){//已选中后点击输入框不取消选中
|
|
|
e.stopPropagation();
|
|
|
}
|
|
|
}
|