<template>
  <div class="allInput">
    <div :class="screen==1?'asideinput1':screen==2?'asideinput2':''">
        <el-input  v-model="asideinput" :placeholder="title" clearable></el-input>
        <i class="el-icon-search" :style="i_style" :class="size=='medium'?'i-medium':size=='small'?'i-small':size=='mini'?'i-mini':''"></i>
    </div>
  </div>
</template>

<script>
import {_debounce} from '@/api/auth';	
export default {
    name:'JxSearch',
    props:{
        title:{
            type: String,
            default: '请输入',
        },
        screen:{//搜索框样式
            type: Number,
            default: 1,
        },
        size:{//medium / small / mini
            type: String,
            default: 'medium',
        },
        i_style:{//i样式
            type: String,
            default: '',
        },
        times:{//延迟时间
            type: Number,
            default: 400,
        },
    },
  data() {
    return {
        asideinput:'',
    };
  },
  watch: {
    asideinput:_debounce(
      function () {
        this.$emit('confirm', this.asideinput)
      },
    ),
  },
  created() {
  },
  mounted() {},
  methods: {
  }
};
</script>

<style scoped="scoped" lang="scss">

/* .asideinput{
} */


.allInput{
  position: relative;
  i{
    position: absolute;
    left: 13px;
    color: #a5a5a5;
  }
  
  /* 样式1 */
  .asideinput1 {
    ::v-deep .el-input__inner{
      background-color: #f3f3f3;
      border: 0;
      padding-left: 32px;
      border-radius: 20px;
    }
    ::v-deep .el-input__inner::placeholder{
      color:#aaaaaa;;
    }
  }

  /* 样式2 */
  .asideinput2 {
    ::v-deep .el-input__inner{
      background-color: #ffffff;
      padding-left: 32px;
      border-radius: 4px;
    }
    ::v-deep .el-input__inner::placeholder{
      color:#aaaaaa;;
    }
  }
  
  .i-medium{
    top: 11px;
    font-size: 14px;
  }
  .i-small{
    top: 9px;
    font-size: 14px;
  }
  .i-mini{
    top: 8px;
    font-size: 12px;
  }
}
</style>
