mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-12-11 13:22:35 +00:00
23 lines
536 B
Rust
23 lines
536 B
Rust
use dioxus::desktop::{use_asset_handler, wry::http::Response};
|
|
use dioxus::prelude::*;
|
|
|
|
fn main() {
|
|
launch_desktop(app);
|
|
}
|
|
|
|
fn app() -> Element {
|
|
use_asset_handler("logos", |request, response| {
|
|
// We get the original path - make sure you handle that!
|
|
if request.uri().path() != "/logos/logo.png" {
|
|
return;
|
|
}
|
|
|
|
response.respond(Response::new(include_bytes!("./assets/logo.png").to_vec()));
|
|
});
|
|
|
|
rsx! {
|
|
div {
|
|
img { src: "/logos/logo.png" }
|
|
}
|
|
}
|
|
}
|