<template>
  <div class="search-box" :style="{ width }">
    <el-input
      placeholder="输入关键词查询"
      :value="value"
      @input="changeInput"
    ></el-input>
    <el-button class="search-btn" @click="handleSearch">
      <span class="flex aic jcc">
        <img class="mr10" src="../assets/img/sousuo.png" /> 搜索
      </span>
    </el-button>
  </div>
</template>

<script>
export default {
  model: {
    prop: "value",
    event: "input",
  },
  props: {
    width: {
      type: String,
      default: "600px",
    },
    value: {
      type: String,
      Number,
      default: "",
    },
  },
  data() {
    return {};
  },
  methods: {
    changeInput(val) {
      this.$emit("input", val);
    },
    handleSearch() {
      this.$emit("click");
    },
  },
};
</script>

<style lang="less" scoped>
.search-box {
  box-shadow: 0px 7px 13px 0px rgba(0, 0, 0, 0.1);
  position: relative;
}
.search-btn {
  width: 167px;
  height: 62px;
  background: linear-gradient(
    90deg,
    var(--main-theme-color1),
    var(--main-assist-color1)
  );
  border-radius: 8px;
  color: #ffffff;
  font-size: 24px;
  border: none;
  position: absolute;
  right: 5px;
  top: 5px;
}

/deep/.el-input__inner {
  height: 72px;
  padding-right: 200px;
  font-size: 24px;
  border-radius: 8px;
  color: #333;
}
</style>