Now functioning frontend

Changed some things to make trunk work
This commit is contained in:
2026-04-28 06:36:01 +02:00
parent 76b4ccf943
commit ce86d8bc8f
4 changed files with 14 additions and 9 deletions

View File

@@ -4,7 +4,11 @@ version = "0.1.0"
edition = "2024" edition = "2024"
[lib] [lib]
crate-type = ["cdylib"] crate-type = ["cdylib", "rlib"]
[[bin]]
name = "bin"
path = "src/main.rs"
[dependencies] [dependencies]
yew = { version = "0.23", features = ["csr"] } yew = { version = "0.23", features = ["csr"] }

View File

@@ -1,9 +1,10 @@
<!doctype html> <!doctype html>
<html> <html>
<head> <head>
<link data-trunk rel="rust" data-bin="bin" />
<meta charset="utf-8" /> <meta charset="utf-8" />
<title>Yew App</title> <title>Yew App</title>
<link data-trunk rel="rust" href="Cargo.toml">
</head> </head>
<body></body> <body></body>
</html> </html>

View File

@@ -1,8 +1,7 @@
use serde::{Deserialize, Serialize};
use yew::prelude::*; use yew::prelude::*;
#[component] #[function_component]
fn App() -> Html { pub fn App() -> Html {
let counter = use_state(|| 0); let counter = use_state(|| 0);
let onclick = { let onclick = {
let counter = counter.clone(); let counter = counter.clone();
@@ -19,7 +18,3 @@ fn App() -> Html {
</div> </div>
} }
} }
fn main() {
yew::Renderer::<App>::new().render();
}

5
frontend/src/main.rs Normal file
View File

@@ -0,0 +1,5 @@
use frontend::App;
fn main() {
yew::Renderer::<App>::new().render();
}