pub struct TreeSelectProps {Show 15 fields
pub tree_data: Option<Vec<TreeNode>>,
pub value: Option<String>,
pub values: Option<Vec<String>>,
pub multiple: bool,
pub tree_checkable: bool,
pub show_search: bool,
pub placeholder: Option<String>,
pub disabled: bool,
pub status: Option<ControlStatus>,
pub size: Option<ComponentSize>,
pub class: Option<String>,
pub style: Option<String>,
pub dropdown_class: Option<String>,
pub dropdown_style: Option<String>,
pub on_change: Option<EventHandler<Vec<String>>>,
}Expand description
Props for the TreeSelect component (MVP subset).
MVP 行为说明:
- 支持单选 / 多选(
multiple或tree_checkable任一为 true 即视为多选) - 简单 label 搜索(show_search,基于节点 label 的本地过滤)
- 树结构默认全部展开,通过缩进展示层级;暂不支持折叠/半选状态
- 与 Form 的值双向绑定,复用 Select 的表单集成逻辑
Fields§
§tree_data: Option<Vec<TreeNode>>树形数据源。每个节点包含 key / label / disabled / children。
value: Option<String>单选模式下的受控值。
values: Option<Vec<String>>多选模式下的受控值集合。
multiple: bool是否启用多选模式(结合 tree_checkable 使用)。
tree_checkable: bool是否在树节点前显示复选框(勾选模式)。
show_search: bool是否启用简单搜索(基于 label 的本地过滤)。
placeholder: Option<String>占位文案。
disabled: bool禁用整个选择器。
status: Option<ControlStatus>视觉状态(success / warning / error)。
size: Option<ComponentSize>组件尺寸,默认跟随 ConfigProvider。
class: Option<String>自定义类名与样式。
style: Option<String>§dropdown_class: Option<String>弹层额外类名与样式。
dropdown_style: Option<String>§on_change: Option<EventHandler<Vec<String>>>选中集合变更回调(单选约定 Vec 长度为 0 或 1)。
Implementations§
Source§impl TreeSelectProps
impl TreeSelectProps
Sourcepub fn builder() -> TreeSelectPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> TreeSelectPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building TreeSelectProps.
On the builder, call .tree_data(...)(optional), .value(...)(optional), .values(...)(optional), .multiple(...)(optional), .tree_checkable(...)(optional), .show_search(...)(optional), .placeholder(...)(optional), .disabled(...)(optional), .status(...)(optional), .size(...)(optional), .class(...)(optional), .style(...)(optional), .dropdown_class(...)(optional), .dropdown_style(...)(optional), .on_change(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of TreeSelectProps.
Trait Implementations§
Source§impl Clone for TreeSelectProps
impl Clone for TreeSelectProps
Source§fn clone(&self) -> TreeSelectProps
fn clone(&self) -> TreeSelectProps
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more