Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changes/change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"create-tauri-app": patch
"create-tauri-app-js": patch
---

fix template-dioxus loading assets error
10 changes: 7 additions & 3 deletions templates/template-dioxus/src/app.rs.lte
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ use dioxus::prelude::*;
use serde::{Deserialize, Serialize};
use wasm_bindgen::prelude::*;

static CSS: Asset = asset!("/assets/styles.css");
static TAURI_ICON: Asset = asset!("/assets/tauri.svg");
static DIOXUS_ICON: Asset = asset!("/assets/dioxus.png");

#[wasm_bindgen]
extern "C" {
#[wasm_bindgen(js_namespace = ["window", "__TAURI__", "{% if v2 %}core{% else %}tauri{% endif %}"])]
Expand Down Expand Up @@ -32,7 +36,7 @@ pub fn App() -> Element {
};

rsx! {
link { rel: "stylesheet", href: "styles.css" }
link { rel: "stylesheet", href: CSS }
main {
class: "container",
h1 { "Welcome to Tauri + Dioxus" }
Expand All @@ -43,7 +47,7 @@ pub fn App() -> Element {
href: "https://tauri.app",
target: "_blank",
img {
src: "/tauri.svg",
src: TAURI_ICON,
class: "logo tauri",
alt: "Tauri logo"
}
Expand All @@ -52,7 +56,7 @@ pub fn App() -> Element {
href: "https://dioxuslabs.com/",
target: "_blank",
img {
src: "/dioxus.png",
src: DIOXUS_ICON,
class: "logo dioxus",
alt: "Dioxus logo"
}
Expand Down
Loading