<style lang="scss" scoped>
	.change-input {
		position: relative;
		width: 164px;
		height: 60px;
		line-height: 60px;
		text-align: center;
		background: #ffffff;
		border: 1px solid #dddddd;
		border-radius: 4px;
		font-size: 25px;
		input{
			position: absolute;
			width: 100%;
			height: 100%;
			//opacity:1;
			&.active{
				//opacity:0;
			}
		}
		text{
			&.active{
				background: rgba(10,150,210,0.6);
			}
		}
	}
</style>
<template>
	<view class="change-input">
			<input :focus="isFocus" :style="isActive?'caret-color:rgba(0,0,0,0)':'caret-color:rgba(0,0,0,1)'"  type="number" @focus="initAllInput" @blur="moveAllInput" v-model="inputVal" @input="changeAllInput" :placeholder="value==''&&inputVal==''?placeholder:''">
			<text :class="isActive?'active':''">{{value?value:''}}</text>
	</view>
</template>
<script>
export default {
  name: "allSelectInput",
	props: {
		isActive: '',
		isFocus: '',
		value: '',
		placeholder: '',
	},
	data() {
		return {
			inputVal:'',
		};
	},
	onLoad(e){
  	this.title = e.title
	},
  methods: {
			initAllInput() {
				this.$emit('initAllInput')
    },
			moveAllInput(){
				let inputVal = this.inputVal
				this.inputVal = '';
				this.$emit('moveAllInput',inputVal)
			},
			changeAllInput(e){
    	if(e.detail.keyCode==8){
    		this.$emit('deleteInputVal')
						return;
					}
				this.$emit('deleteInputVal')
				// else{
					// 	this.$emit('enteringInputVal',e.detail.value)
					// 	console.log(e.detail.value)
					// }

			},
  },
};
</script>
