<!-- src/components/search-form/fields/DateField.vue -->
<template>
  <el-date-picker
    :model-value="modelValue"
    type="date"
    :placeholder="placeholder"
    :disabled="disabled"
    :value-format="valueFormat"
    :disabled-date="disabledDate"
    style="width: 100%"
    @update:model-value="handleChange" 
  />
</template>

<script setup>
const props = defineProps({
  modelValue: String, // 注意：不能是 required，因为可能为 null
  placeholder: String,
  disabled: Boolean,
  valueFormat: String,
  disabledDate: Function
})

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

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