<template>
  <div class="quick-search-wrapper">
    <rt-search
    :placeholder="placeholder"
    :show-search-button="showBtn"
    v-model="quickSearch"
    @on-search="search" />
  </div>

</template>
<script>
export default {
  name: 'rtListQuickSearch',
  props: {
    value: String,
    placeholder: {
      type: String,
      default: '输入名称快速搜索'
    },
    showBtn: {
      type: Boolean,
      default: false
    },
    quickSearchText: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      quickSearch: ''
    };
  },
  mounted() {
    this.init();
  },
  methods: {
    search() {
      this.$emit('input', this.quickSearch);
      this.$emit('on-search', this.quickSearch);
    },
    init() {
      this.quickSearch = this.quickSearchText;
    }
  }
};
</script>
<style lang="less">
.quick-search-wrapper{
  flex: 1;
}
</style>
