<template>
  <div class="build_input">
        <i class="iconfont icon-sousuo"></i>
        <input type="text" v-model="value" :placeholder="placeholder" @keyup.enter="search">
    </div>
</template>

<script>
export default {
    props: [ 'placeholder'],
    data(){
        return{
            value: ''
        }
    },
    methods: {
        search(){
            this.$emit("search",this.value)
        },
    },
}
</script>

<style lang="less" scoped>
.build_input{
    display: inline-block;
    width: 23rem;
    height: 2rem;
    font-size: 1.4rem;
    position: relative;
    input{
        width: 100%;
        height: 100%;
        padding-left: 2rem;
        font-size: .8rem;
        box-sizing: border-box;
    }
    .icon-sousuo{
        position: absolute;
        width: 2rem;
        height: 2rem;
        left: 0;
        top: 3px;
        bottom: 0;
        line-height: 2rem;
        text-align: center;
    }
}
</style>
