From 8bd10b5493ff53f656b9df18c0f3272c8c2a2ad5 Mon Sep 17 00:00:00 2001 From: Kenzi Connor Date: Tue, 23 Jul 2024 00:26:09 -0700 Subject: [PATCH] just store the html/vnode --- src/wasm/main.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/wasm/main.rs b/src/wasm/main.rs index 67bc969..d0fee4c 100644 --- a/src/wasm/main.rs +++ b/src/wasm/main.rs @@ -1,5 +1,6 @@ #![cfg(feature = "wasm")] use yew::prelude::*; +use yew::virtual_dom::VNode; use cega::wasm::image::*; use cega::wasm::{FileInput, FileUpload}; @@ -9,7 +10,7 @@ pub enum Msg { } pub struct App { - files: Vec, + images: Vec, } impl Component for App { @@ -18,14 +19,14 @@ impl Component for App { fn create(_ctx: &Context) -> Self { Self { - files: Vec::default(), + images: Vec::default(), } } fn update(&mut self, _ctx: &Context, msg: Self::Message) -> bool { match msg { Msg::Loaded(file) => { - self.files.push(file); + self.images.push(html! { }); } } true @@ -37,9 +38,7 @@ impl Component for App {

{ "Process your CGA/EGAs" }

- {for self.files.iter().map(|f| - html! { } - )} + {{ self.images.clone() }}
}