跳到正文

DateField

可通过键盘编辑的分段日期字段,日期部分会适配区域设置。

正在加载交互演示…

#导入

从 quickgui 导入 DateField。

use quickgui::*;

#用法

let field = DateField::new("start");
field.root().flex_row()

#结构

  • DateField::root
  • DateField::segment

#API 参考

展开条目查看说明和完整签名。短横线表示声明中未记录默认值。

DateField

查看源码
pub fn new(root_id: impl Into<ElementId>) -> Self
root_idpub const fn root_id(self) -> ElementId—

Configures root id for this part.

pub const fn root_id(self) -> ElementId
查看源码
segment_idpub fn segment_id(self, segment: DateSegment) -> ElementId—

Configures segment id for this part.

pub fn segment_id(self, segment: DateSegment) -> ElementId
查看源码
segmentpub const fn segment(self, segment: DateSegment) -> DateFieldSegment—

Describe one segment so its part and typed actions can be attached.

pub const fn segment(self, segment: DateSegment) -> DateFieldSegment
查看源码

DateField::root_with

查看源码
pub fn root_with(self, state: &DateFieldState, root: Element) -> Element

Decorate an application-owned root without adding layout or appearance. The root is the group that owns the field's accessible name, its disabled state, its validity, and the active-descendant relationship to the segment being edited.

DateField::root

查看源码
pub fn root(self, state: &DateFieldState) -> Element

Create the unstyled root part. Use [`Self::root_with`] to supply an existing element.