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::*;
4
4
use serde::{Deserialize, Serialize};
5
5
use wasm_bindgen::prelude::*;
6
6
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
+
7
11
#[wasm_bindgen]
8
12
extern "C" {
9
13
#[wasm_bindgen(js_namespace = ["window", "__TAURI__", "{% if v2 %}core{% else %}tauri{% endif %}"])]
@@ -32,7 +36,7 @@ pub fn App() -> Element {
32
36
};
33
37
34
38
rsx! {
35
- link { rel: "stylesheet", href: "styles.css" }
39
+ link { rel: "stylesheet", href: CSS }
36
40
main {
37
41
class: "container",
38
42
h1 { "Welcome to Tauri + Dioxus" }
@@ -43,7 +47,7 @@ pub fn App() -> Element {
43
47
href: "https://tauri.app",
44
48
target: "_blank",
45
49
img {
46
- src: "/tauri.svg" ,
50
+ src: TAURI_ICON ,
47
51
class: "logo tauri",
48
52
alt: "Tauri logo"
49
53
}
@@ -52,7 +56,7 @@ pub fn App() -> Element {
52
56
href: "https://dioxuslabs.com/",
53
57
target: "_blank",
54
58
img {
55
- src: "/dioxus.png" ,
59
+ src: DIOXUS_ICON ,
56
60
class: "logo dioxus",
57
61
alt: "Dioxus logo"
58
62
}
You can’t perform that action at this time.
0 commit comments