Renderers are now packages, not features. (#387)
* feat: use synchronous router design * feat: function to get router out of dom * chore: restructure workspace to use renderers as packages, not features
This commit is contained in:
1 parent
c97ca7dff6
commit
d9546d9504
181 files changed
+487
-1463
No files matched your search
+4
-9
@@ -1,25 +1,21 @@
|
||||
use dioxus::prelude::*;
|
||||
use dioxus_router::{Link, Route, Router};
|
||||
|
||||
fn main() {
|
||||
dioxus::desktop::launch(app);
|
||||
dioxus_desktop::launch(app);
|
||||
}
|
||||
|
||||
fn app(cx: Scope) -> Element {
|
||||
cx.render(rsx! (
|
||||
div {
|
||||
p {
|
||||
a {
|
||||
href: "http://dioxuslabs.com/",
|
||||
"Default link - links outside of your app"
|
||||
}
|
||||
a { href: "http://dioxuslabs.com/", "Default link - links outside of your app" }
|
||||
}
|
||||
p {
|
||||
a {
|
||||
href: "http://dioxuslabs.com/",
|
||||
prevent_default: "onclick",
|
||||
onclick: |_| {
|
||||
println!("Hello Dioxus");
|
||||
},
|
||||
onclick: |_| println!("Hello Dioxus"),
|
||||
"Custom event link - links inside of your app",
|
||||
}
|
||||
}
|
||||
@@ -28,7 +24,6 @@ fn app(cx: Scope) -> Element {
|
||||
Router {
|
||||
Route { to: "/", h1 { "Home" } },
|
||||
Route { to: "/settings", h1 { "settings" } },
|
||||
|
||||
p { "----"}
|
||||
ul {
|
||||
Link { to: "/", li { "Router link to home" } },
|
||||
|
||||
Reference in new issue
Block a user