-
I just created a new Dioxus desktop app for a test via After the example was built properly, I extended the original code in const IMG_WORKING_DESK: Asset = asset!("/assets/working_desk.jpg");
#[component]
pub fn Hero() -> Element {
rsx! {
div {
....
img { src: IMG_WORKING_DESK, id: "working-desk" }
....
}
}
}
} Here is the complete code for use dioxus::prelude::*;
const FAVICON: Asset = asset!("/assets/favicon.ico");
const MAIN_CSS: Asset = asset!("/assets/main.css");
const HEADER_SVG: Asset = asset!("/assets/header.svg");
const IMG_WORKING_DESK: Asset = asset!("/assets/working_desk.jpg");
fn main() {
dioxus::launch(App);
}
#[component]
fn App() -> Element {
rsx! {
document::Link { rel: "icon", href: FAVICON }
document::Link { rel: "stylesheet", href: MAIN_CSS }
Hero {}
}
}
#[component]
pub fn Hero() -> Element {
rsx! {
div {
id: "hero",
img { src: HEADER_SVG, id: "header" }
img { src: IMG_WORKING_DESK, id: "working-desk" }
div { id: "links",
a { href: "https://dioxuslabs.com/learn/0.6/", "📚 Learn Dioxus" }
a { href: "https://dioxuslabs.com/awesome", "🚀 Awesome Dioxus" }
a { href: "https://github.com/dioxus-community/", "📡 Community Libraries" }
a { href: "https://github.com/DioxusLabs/sdk", "⚙️ Dioxus Development Kit" }
a { href: "https://marketplace.visualstudio.com/items?itemName=DioxusLabs.dioxus", "💫 VSCode Extension" }
a { href: "https://discord.gg/XgGxMSkvUM", "👋 Community Discord" }
}
}
}
} I create the app using I would expect to see this instead of nothing: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Does nobody have this problem? I mean I use the desktop template and notice that images are not displayed. Can anyone confirm this? I use Linux as System. At the Moment I stick to Dioxus 0.5.6 because the images are displayed there. |
Beta Was this translation helpful? Give feedback.
-
The problem is an dependency and is not due to Dioxus. The images are displayed in the AppImage version of my program. If I extract the AppImage using |
Beta Was this translation helpful? Give feedback.
The problem is an dependency and is not due to Dioxus. The images are displayed in the AppImage version of my program. If I extract the AppImage using
--appimage-extract
then the images are displayed when I runAppRun
. If I run the binary directly, the images are found but not displayed. So there must be an external lib responsible for the error, I just don't know which one yet.