mirror of
https://github.com/yewprint/yewprint
synced 2024-11-25 13:00:19 +00:00
Tree: NodeData impl Clone if possible
This commit is contained in:
parent
3c5a8af353
commit
913798243d
1 changed files with 17 additions and 0 deletions
17
src/tree.rs
17
src/tree.rs
|
@ -85,6 +85,23 @@ impl<T: Default> Default for NodeData<T> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<T: Clone> Clone for NodeData<T> {
|
||||
fn clone(&self) -> Self {
|
||||
Self {
|
||||
disabled: self.disabled,
|
||||
has_caret: self.has_caret,
|
||||
icon: self.icon,
|
||||
icon_color: self.icon_color.clone(),
|
||||
icon_intent: self.icon_intent,
|
||||
is_expanded: self.is_expanded,
|
||||
is_selected: self.is_selected,
|
||||
label: self.label.clone(),
|
||||
secondary_label: self.secondary_label.clone(),
|
||||
data: self.data.clone(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Clone + PartialEq + 'static> Component for Tree<T> {
|
||||
type Message = ();
|
||||
type Properties = Props<T>;
|
||||
|
|
Loading…
Reference in a new issue