export default {
  props: {
    time: null,
    enableTime: {
      type: Boolean,
      default: true
    }
  },
  watch: {
    time (value) {
      if (this.enableTime) {
        this.setTime(value);
      }
    }
  },
  methods: {
    refreshTime () {
      if (this.enableTime) {
        this.setTime();
      }
    },
    setTime () {
      this.search();
    },
  },
  mounted () {
    this.$on('refreshTime', this.refreshTime.bind(this));
  }
};
