<template>
    <el-input
            class="search-name"
            :placeholder="placeholder"
            v-model="value"
            @change="handleChange"
            clearable>
    </el-input>
</template>

<script>
    export default {
        name: 'MyInput',
        props: {
            placeholder: {
                type: String,
                default: '请输入'
            },
            action: {
                type: String,
                required: true
            }
        },
        data() {
            return {
                value: ''
            }
        },
        methods: {
            handleChange(data) {
                this.$emit('change', this.action, data)
            },
            setInputValue(data) {
                this.value = data;
                this.$emit('change', this.action, data)
            }
        }
    };
</script>

<style scoped>

</style>