
<template>
  <div class="rang-picker">
    <a-range-picker v-model="timeRange" :format="format" :allowClear="allowClear" :disabled-date="disabledDate" />
  </div>
</template>

<script>
// import { dictionary } from '@/components/service/core/dictionary'
import { isArray } from '@/utils/Tools'
import { httpAction, getAction } from '@/api/manage'
import moment from 'moment'
export default {
  name: 'rang-picker', // 日期选择器组件二次封装
  props: {
    format: {
      type: String,
      default() {
        return 'YYYY-MM-DD'
      },
    },
    allowClear: {
      type: Boolean,
      default() {
        return false
      },
    },
    disabledDate: {
      type: Function,
      default(current) {
        return current && current < moment().subtract(1, 'days')
      },
    },
    value: {
      // v-model绑定值
      type: [Array, String],
      default() {
        return []
      },
    },
    disabled: {
      // 是否禁用
      type: Boolean,
      default: false,
    },
  },
  components: {},
  data() {
    return {
      selectOption: [],
    }
  },
  watch: {},
  computed: {
    timeRange: {
      get: function () {
        return this.value
      },
      set: function (val) {
        this.$emit('input', val)
      },
    },
  },
  mounted() {
    this.$nextTick(() => {})
  },
  methods: {
    emitChange(...args) {
      // emit change事件
      this.$emit('change', ...args)
    },
  },
}
</script>

