diff options
author | Ashelyn Rose <git@ashen.earth> | 2025-04-26 21:55:30 -0600 |
---|---|---|
committer | Ashelyn Rose <git@ashen.earth> | 2025-04-26 21:55:30 -0600 |
commit | 864e058f009eb0416d86e9461726d3f97e956df9 (patch) | |
tree | 4bdd2e0c290df82601726a976f09ba87bb52db3a /modules/site_test/src | |
parent | 57f68899cd2200568c53201c6fd1ced85b613a3b (diff) |
Diffstat (limited to 'modules/site_test/src')
-rw-r--r-- | modules/site_test/src/main.rs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/modules/site_test/src/main.rs b/modules/site_test/src/main.rs index 9201c8a..b0fe9f3 100644 --- a/modules/site_test/src/main.rs +++ b/modules/site_test/src/main.rs @@ -3,7 +3,7 @@ use morgana::{morx, Component, RenderNode}; pub fn main() { let parent = morx! { ParentLayout { - Child { + Child some_prop={"something".to_string()} { "Hello world!" } } @@ -19,10 +19,13 @@ struct ParentLayout { impl Component for ParentLayout { fn render(self: Box<Self>) -> RenderNode { + let string = "test string"; + morx!{ + !doctype html; html lang = "en-US" { head { - title = "test thing" + title ={string} } body = {self.children} } @@ -31,13 +34,15 @@ impl Component for ParentLayout { } struct Child { - children: Vec<RenderNode> + children: Vec<RenderNode>, + some_prop: String, } impl Component for Child { fn render(self: Box<Self>) -> RenderNode { morx! { p= {self.children} + p= {self.some_prop} } } } |