<template>
  <el-date-picker
    :model-value="modelValue"
    type="daterange"
    range-separator="至"
    start-placeholder="开始日期"
    end-placeholder="结束日期"
    :value-format="valueFormat"
    :disabled="disabled"
    :disabled-date="disabledDate"
    style="width: 100%"
    @update:model-value="handleChange"
  />
</template>

<script setup>
const props = defineProps({
  modelValue: Array,
  valueFormat: String,
  disabled: Boolean,
  disabledDate: Function
})

const emit = defineEmits(['update:modelValue'])

function handleChange(value) {
  emit('update:modelValue', value)
}
</script>