<!--
 * @Author: your name
 * @Date: 2021-10-18 17:44:42
 * @LastEditTime: 2021-10-19 11:18:27
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \Foshan4A\src\views\account\components\search.vue
-->
<template>
  <div class="pub-search">
    <div class="search">
      <el-input :placeholder="placeholder" clearable v-model="input">
        <el-button slot="prepend" icon="el-icon-search"></el-button>
      </el-input>
    </div>
    <div class="btn">
      <button @click="checkSearch" class="btnAn">搜索</button>
    </div>
    <div class="add">
      <slot></slot>
    </div>
  </div>
</template>

<script>
export default {
  name: "PubSearch",
  props: {
    placeholder: {
      type: String,
      default: "请输入内容",
    },
    Turnoff: {
      type: String,
    },
  },
  data() {
    return {
      input: "",
    };
  },
  methods: {
    checkSearch() {
      this.$emit("getSearchData", this.input);
    },
  },
};
</script>

<style lang="scss" scoped>
.pub-search {
  display: flex;
  > div {
    margin-right: 24px;
    &:last-child {
      margin-right: 0;
    }
  }
  ::v-deep .search {
    width: 320px;
    height: 48px;
    line-height: 48px;
    padding: 0 24px;
    background: #ffffff;
    box-shadow: 0px 6px 7px 0px rgba(0, 0, 0, 0.06);
    border-radius: 6px;
    .el-input-group__prepend {
      background-color: #fff;
      border: none;
      padding-left: 0;
      padding-right: 15px;
      .el-icon-search {
        font-size: 16px;
        font-weight: bold;
      }
    }
    .el-input__inner {
      border: none;
      padding: 0;
      font-size: 16px;
    }
  }
  .btnAn {
    width: 96px;
    height: 48px;
    background: linear-gradient(0deg, #777dba, #6983be);
    box-shadow: 0px 3px 4px 0px rgba(0, 0, 0, 0.18);
    border-radius: 6px;
    outline: none;
    border: none;
    cursor: pointer;
    color: #fff;
    font-size: 16px;
    font-family: Microsoft YaHei;
    font-weight: bold;
  }
  .btnAdd {
    width: 120px;
    height: 48px;
    background: #f5f7fa;
    border: 1px solid #b4b7cb;
    box-shadow: 0px 6px 7px 0px rgba(0, 0, 0, 0.06);
    border-radius: 6px;
    font-size: 16px;
    font-family: Microsoft YaHei;
    font-weight: bold;
    color: #6f81bc;
    cursor: pointer;
  }
}
</style>