File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
templates/template-dioxus/src Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " create-tauri-app " : patch
3+ " create-tauri-app-js " : patch
4+ ---
5+
6+ fix template-dioxus loading assets error
Original file line number Diff line number Diff line change @@ -4,6 +4,10 @@ use dioxus::prelude::*;
44use serde::{Deserialize, Serialize};
55use wasm_bindgen::prelude::*;
66
7+ static CSS: Asset = asset!("/assets/styles.css");
8+ static TAURI_ICON: Asset = asset!("/assets/tauri.svg");
9+ static DIOXUS_ICON: Asset = asset!("/assets/dioxus.png");
10+
711#[wasm_bindgen]
812extern "C" {
913 #[wasm_bindgen(js_namespace = ["window", "__TAURI__", "{% if v2 %}core{% else %}tauri{% endif %}"])]
@@ -32,7 +36,7 @@ pub fn App() -> Element {
3236 };
3337
3438 rsx! {
35- link { rel: "stylesheet", href: "styles.css" }
39+ link { rel: "stylesheet", href: CSS }
3640 main {
3741 class: "container",
3842 h1 { "Welcome to Tauri + Dioxus" }
@@ -43,7 +47,7 @@ pub fn App() -> Element {
4347 href: "https://tauri.app",
4448 target: "_blank",
4549 img {
46- src: "/tauri.svg" ,
50+ src: TAURI_ICON ,
4751 class: "logo tauri",
4852 alt: "Tauri logo"
4953 }
@@ -52,7 +56,7 @@ pub fn App() -> Element {
5256 href: "https://dioxuslabs.com/",
5357 target: "_blank",
5458 img {
55- src: "/dioxus.png" ,
59+ src: DIOXUS_ICON ,
5660 class: "logo dioxus",
5761 alt: "Dioxus logo"
5862 }
You can’t perform that action at this time.
0 commit comments