updated structure
This commit is contained in:
+22
-19
@@ -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
|
||||
// }
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user