# VDatePicker 组件 API 文档

## 组件简介 | Component Introduction
`VDatePicker` 是基于 Element Plus 的日期选择器组件，支持多种类型和插槽自定义。

`VDatePicker` is a date picker component based on Element Plus, supporting multiple types and custom slots.

---

## Props/属性
| 属性名 | 说明 | 类型 | 是否必填 | 默认值 |
|--------|------|------|----------|--------|
| field  | 日期选择器配置对象，详见下表 | Object | 是 | - |

---

## v-model
- 绑定值类型：`Date | Array | Number | String`
- 用法：`v-model="dateValue"`

---

## 插槽 | Slots
| 插槽名 | 说明 |
|--------|------|
| default | 默认内容（日期单元格）|
| range-separator | 范围分隔符 |

---

## 方法 | Methods (通过 ref 调用)
| 方法名 | 说明 |
|--------|------|
| focus(...args) | 使选择器聚焦 |
| handleOpen() | 打开面板 |
| handleClose() | 关闭面板 |

---

## 示例 | Example
```vue
<template>
  <VDatePicker v-model="dateValue" :field="fieldConfig" ref="datePickerRef">
    <template #default="{ cell }">
      <span>{{ cell.text }}</span>
    </template>
  </VDatePicker>
</template>

<script setup>
import { ref } from 'vue'
import { VDatePicker } from 'your-lib-path'

const dateValue = ref('')
const datePickerRef = ref(null)
const fieldConfig = {
  type: 'date',
  placeholder: '请选择日期'
}
</script>
``` 