<template>
<div class="module-search-box">
  <el-input placeholder="请输入文章标题或关键词搜索" v-model="inputSearch" @focus="isFocus" @blur="isBlur" @keyup.enter.native="enterSearch">
    <el-button slot="append" type="primary" @click="enterSearch">搜索</el-button>
  </el-input>
</div>
</template>

<script>
export default {
  props: { },
  data () {
    return {
      inputSearch: '',
      status: false // 处于 focus 状态：true; 处于 blur 状态：false;
    }
  },
  methods: {
    isFocus () { this.status = true },
    isBlur () { this.status = false },
    enterSearch () { this.$emit('enter', this.inputSearch) }
  }
}
</script>
