updated structure

This commit is contained in:
2024-10-16 20:43:34 +02:00
parent 590de19df8
commit 12417848f3
4 changed files with 128 additions and 62 deletions
+22 -19
View File
@@ -1,31 +1,34 @@
use osui::{
components::{div, text, Div},
oml, ComponentParams,
components::{div, text},
oml, Component, Params, Screen,
};
fn main() {
let doc = oml!(div {app()});
println!("{:?}", doc);
let mut screen = Screen::new();
screen.set_component(oml!(app()));
screen.run();
}
fn app(_: ComponentParams) -> Div {
*oml!(
fn app(_: Params) -> Component {
oml!(
// Components (C)
div {
// Props, With components (PC)
div () {
// Props (P)
text(/* Properties go here, Example: x = 20 y = 5 */)
}
div (width = 5, height = 3) {
// Expression (E)
text("Hello";)
text("Hello, World! daddy"; width = 30)
// Expression, With components (EC)
text("World!";) {
// Components in here
}
// // Props, With components (PC)
// div () {
// // Props (P)
// text(/* Properties go here, Example: x = 20 y = 5 */)
// }
// // Expression (E)
// text("Hello";)
// // Expression, With components (EC)
// text("World!";) {
// // Components in here
// }
}
)
}