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"
[lib]
crate-type = ["cdylib"]
crate-type = ["cdylib", "rlib"]
[[bin]]
name = "bin"
path = "src/main.rs"
[dependencies]
yew = { version = "0.23", features = ["csr"] }

View File

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

View File

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