<!-- -->
<template>
  <div class="search-bar">
    <!-- <el-select v-model="select" placeholder="请选择">
      <el-option
        v-for="item in options"
        :key="item.value"
        :label="item.label"
        :value="item.value"
      >
      </el-option>
    </el-select> -->
    <el-input
      v-model="searchValue"
      placeholder="请输入关键词"
      class="center"
      @keyup.enter.native="search"
    ></el-input>
    <el-button style="width: 300px" round type="primary" @click.native="search"
      >检索</el-button
    >
  </div>
</template>

<script>
export default {
  name: "SearchBar",
  props: {
    options: {
      type: Array,
      default: () => [],
    },
    selectValue: {
      type: String,
      default: "",
    },
    keyword: {
      type: String,
      default: "",
    },
  },
  data() {
    return {
      searchValue: "",
    };
  },
  watch: {
    keyword(value) {
      this.searchValue = value;
    },
  },
  mounted() {},
  methods: {
    search() {
      this.$emit("search", this.searchValue);
    },
  },
};
</script>

<style lang="scss" scoped>
.search-bar {
  width: 100%;
  display: flex;
  .center {
    margin: 0 16px;
  }
}
</style>
