<!--
 * @Descripttion: 输入框全等于检索组件
 * @Author: 龙运模
 * @Date: 2024年07月11日
 * @LastEditors: 龙运模
 * @LastEditTime:
-->

<template>
	<div class="scDatePicker">
		<el-input v-bind="$attrs" class="input" v-model="localText" @input="textChange" :size="size" :placeholder="placeholder" clearable></el-input>
	</div>
</template>

<script>
export default {
	name: "index",
	props:{
		activation_text: {
			type: String,
			default: ""
		},
		size:{ type: String, default: "small" },
		placeholder:{type:String, default:"请输入关键字"},
	},
	watch:{
		activation_text:{
			handler(val){
				this.localText = val;
			},
			deep:true
		}
	},
	data(){
		return{
			localText:this.activation_text,
		}
	},
	mounted() {

	},
	methods:{
		textChange(e){
			this.localText = e;
			this.emitActivationText();
		},
		emitActivationText() {
			this.$emit('update:activation_text', this.localText);
			this.$emit('fetchData');
		}
	}
}
</script>

<style scoped lang="scss">
.scDatePicker{
	width: 100%;
}
</style>
