SxDateTimePicker (日期时间选择)
NextUI 扩展组件。一体化选择日期和时间。
使用场景
约束说明
ReadOnly 与 Disabled 都会阻止变更。
- 使用原生
input[type="datetime-local"]。
行为说明
API
Parameters (参数)
| 状态 |
参数名 |
类型 |
默认值 |
描述 |
| Implemented |
Value |
DateTime? |
null |
当前选中的日期时间(支持双向绑定)。 |
| Implemented |
Label |
string? |
null |
顶部标签文本。 |
| Implemented |
ReadOnly |
bool |
false |
是否为只读状态。 |
| Implemented |
Autofocus |
bool |
false |
页面加载时自动获取焦点。 |
| Implemented |
AccessKey |
string? |
null |
快捷键。 |
| Implemented |
TabIndex |
int? |
null |
Tab 顺序。 |
| Implemented |
AriaLabel |
string? |
null |
辅助功能:aria-label。 |
| Implemented |
Disabled (继承) |
bool |
false |
是否禁用交互。 |
| Implemented |
Id (继承) |
string? |
null |
组件的物理 Id。 |
| Implemented |
Class (继承) |
string? |
null |
自定义 CSS 类名。 |
| Implemented |
Style (继承) |
string? |
null |
自定义样式。 |
| Implemented |
Title (继承) |
string? |
null |
HTML title 属性。 |
| Implemented |
AdditionalAttributes (继承) |
IEnumerable<KeyValuePair<string, object>>? |
null |
捕获不匹配的 HTML 属性。 |
Events (事件)
| 状态 |
事件名 |
类型 |
描述 |
| Implemented |
ValueChanged |
EventCallback<DateTime?> |
值改变时触发。 |
示例
<SxDateTimePicker @bind-Value="_dateTime" Label="预约时间" />
参考设计 (References)