From b63ad74545c6c683105ec9a1fc6c91d5ad9a2d01 Mon Sep 17 00:00:00 2001 From: Yuki Kodama Date: Sun, 22 Mar 2020 17:35:20 +0900 Subject: [PATCH] Remove reproducing example --- examples/Cargo.toml | 1 - examples/std_web/select/Cargo.toml | 11 ------ examples/std_web/select/src/lib.rs | 57 ----------------------------- examples/std_web/select/src/main.rs | 3 -- 4 files changed, 72 deletions(-) delete mode 100644 examples/std_web/select/Cargo.toml delete mode 100644 examples/std_web/select/src/lib.rs delete mode 100644 examples/std_web/select/src/main.rs diff --git a/examples/Cargo.toml b/examples/Cargo.toml index ac301c78999..a2664b1dfee 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -25,7 +25,6 @@ members = [ "std_web/npm_and_rest", "std_web/todomvc", "std_web/two_apps", - "std_web/select", "web_sys/counter", "web_sys/file_upload", "web_sys/inner_html", diff --git a/examples/std_web/select/Cargo.toml b/examples/std_web/select/Cargo.toml deleted file mode 100644 index fbfa09efb1d..00000000000 --- a/examples/std_web/select/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "select_std_web" -version = "0.1.0" -authors = ["Yuki Kodama "] -edition = "2018" - -[dependencies] -stdweb = "0.4.20" -strum = "0.17.1" -strum_macros = "0.17.1" -yew = { path = "../../..", features = ["services", "std_web"] } diff --git a/examples/std_web/select/src/lib.rs b/examples/std_web/select/src/lib.rs deleted file mode 100644 index 8897fa96a23..00000000000 --- a/examples/std_web/select/src/lib.rs +++ /dev/null @@ -1,57 +0,0 @@ -#![recursion_limit = "256"] - -use strum::IntoEnumIterator; -use strum_macros::{Display, EnumIter, EnumString}; -use yew::components::Select; -use yew::{html, Component, ComponentLink, Html, ShouldRender}; - -#[derive(Clone, Debug, Display, EnumString, EnumIter, PartialEq)] -pub enum Fruit { - Apple, - Banana, - Grape, -} - -pub struct Model { - link: ComponentLink, - value: Option, -} - -pub enum Msg { - Set(Fruit), - Clear, -} - -impl Component for Model { - type Message = Msg; - type Properties = (); - - fn create(_: Self::Properties, link: ComponentLink) -> Self { - Model { link, value: None } - } - - fn update(&mut self, msg: Self::Message) -> ShouldRender { - match msg { - Msg::Set(fruit) => { - self.value = Some(fruit); - } - Msg::Clear => { - self.value = None; - } - } - true - } - - fn view(&self) -> Html { - html! { -
- - selected=self.value.clone() - options=Fruit::iter().collect::>() - onchange=self.link.callback(Msg::Set) /> -

{ format!("Selected = {:?}", self.value) }

- -
- } - } -} diff --git a/examples/std_web/select/src/main.rs b/examples/std_web/select/src/main.rs deleted file mode 100644 index 5c29cd038bd..00000000000 --- a/examples/std_web/select/src/main.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - yew::start_app::(); -}