Less clumsy configuration for desktop and mobile (#553)
* chore: dont use prebuilt builder pattern for configuring desktop * chore: use regular config pattern for web * Chore: update docs too * chore: clean up some warnings
This commit is contained in:
1 parent
41b450eedf
commit
540e785d8b
28 files changed
+172
-156
No files matched your search
+10
-7
@@ -2,14 +2,17 @@
|
||||
//! to add things like stylesheets, scripts, and third-party JS libraries.
|
||||
|
||||
use dioxus::prelude::*;
|
||||
use dioxus_desktop::Config;
|
||||
|
||||
fn main() {
|
||||
dioxus_desktop::launch_cfg(app, |c| {
|
||||
c.with_custom_head("<style>body { background-color: red; }</style>".into())
|
||||
});
|
||||
dioxus_desktop::launch_cfg(
|
||||
app,
|
||||
Config::new().with_custom_head("<style>body { background-color: red; }</style>".into()),
|
||||
);
|
||||
|
||||
dioxus_desktop::launch_cfg(app, |c| {
|
||||
c.with_custom_index(
|
||||
dioxus_desktop::launch_cfg(
|
||||
app,
|
||||
Config::new().with_custom_index(
|
||||
r#"
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
@@ -24,8 +27,8 @@ fn main() {
|
||||
</html>
|
||||
"#
|
||||
.into(),
|
||||
)
|
||||
});
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
fn app(cx: Scope) -> Element {
|
||||
|
||||
Reference in new issue
Block a user