diff --git a/crates/yewdux-input/Cargo.toml b/crates/yewdux-input/Cargo.toml index a606892..69d1dea 100644 --- a/crates/yewdux-input/Cargo.toml +++ b/crates/yewdux-input/Cargo.toml @@ -11,3 +11,4 @@ web-sys = "0.3" wasm-bindgen = "0.2" yew = { git = "https://github.com/yewstack/yew.git" } chrono = "0.4.22" +serde = { version = "1.0.114", features = ["rc"] } diff --git a/crates/yewdux-input/src/lib.rs b/crates/yewdux-input/src/lib.rs index ef2da6c..c18d0ac 100644 --- a/crates/yewdux-input/src/lib.rs +++ b/crates/yewdux-input/src/lib.rs @@ -4,6 +4,7 @@ use wasm_bindgen::JsCast; use web_sys::{HtmlInputElement, HtmlTextAreaElement}; use yew::prelude::*; use yewdux::prelude::*; +use serde::{Deserialize, Serialize}; pub enum InputElement { Input(HtmlInputElement), @@ -26,7 +27,7 @@ where } } -#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)] +#[derive(Debug, Default, Copy, Clone, PartialEq, Eq, Deserialize, Serialize)] pub struct Checkbox(bool); impl Checkbox {