<template>
  <div style="display:inline">
    <mk-button :loading="value"
               @click="doSearch"
               :type="2"
               :size="0"
               icon="el-icon-search">筛选</mk-button>
    <mk-button :loading="value"
               @click="doSearch(true)"
               :type="1"
               :size="0"
               icon="el-icon-refresh">重置</mk-button>
  </div>
</template>
<script>
export default {
  name: 'mk-search-buttons',
  props: {
    value: {
      type: Boolean,
      default: false
    }
  },
  computed: {
    loading() {
      return this.value !== false;
    }
  },
  methods: {
    doSearch(reset) {
      this.$emit('search', reset);
      this.$emit('input', reset === true ? null : true);
    }
  }
};
</script>

