PickerDate 日期选择
用于日期时间的选择
示例
import { Header, ScrollView, TopView, Form, FormItem, Card, Divider, DividerGroup, PickerDate } from '@/duxuiExample'
export default function DateExample() {
return <TopView>
<Header title='Date' />
<Form onSubmit={console.log}>
<ScrollView>
<Card margin verticalPadding={false}>
<DividerGroup>
<FormItem label='日期' field='date'>
<PickerDate title='日期' placeholder='请选择日期' grow />
</FormItem>
<FormItem label='年' field='year'>
<PickerDate title='年' placeholder='请选择年' grow mode='year' />
</FormItem>
<FormItem label='月' field='month'>
<PickerDate title='月' placeholder='请选择月' grow mode='month' />
</FormItem>
<FormItem label='日期时间' field='datetime'>
<PickerDate title='日期时间' placeholder='请选择日期时间' grow mode='datetime' />
</FormItem>
<FormItem label='时间' field='time'>
<PickerDate title='时间' placeholder='请选择时间' grow mode='time' />
</FormItem>
</DividerGroup>
</Card>
</ScrollView>
</Form>
</TopView>
}
PickerDate Props
日期选择器
继承自 DatePickerProps
title
弹出选择器的标题
类型 | 必填 | 默认值 |
---|---|---|
string | 否 |
mode
日期选择的模式
类 型 | 必填 | 默认值 |
---|---|---|
enum('datetime', 'date', 'time', 'month', 'year') | 否 | datetime |
minDate
最小时间
类型 | 必填 | 默认值 |
---|---|---|
string | 否 |
maxDate
最大时间
类型 | 必填 | 默认值 |
---|---|---|
string | 否 |
disabled
是否禁用
类型 | 必填 | 默认值 |
---|---|---|
boolean | 否 | false |
defaultValue
默认值
类型 | 必填 | 默认值 |
---|---|---|
string | 否 |
title
弹出选择器的标题
类型 |
---|