mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-10 06:34:20 +00:00
20 lines
456 B
Rust
20 lines
456 B
Rust
use dioxus::prelude::*;
|
|
|
|
#[cfg(not(feature = "collect-assets"))]
|
|
static ASSET_PATH: &str = "examples/assets/logo.png";
|
|
|
|
#[cfg(feature = "collect-assets")]
|
|
static ASSET_PATH: &str = manganis::mg!(image("examples/assets/logo.png").format(ImageType::Avif));
|
|
|
|
fn main() {
|
|
launch_desktop(app);
|
|
}
|
|
|
|
fn app() -> Element {
|
|
rsx! {
|
|
div {
|
|
p { "This should show an image:" }
|
|
img { src: ASSET_PATH.to_string() }
|
|
}
|
|
}
|
|
}
|