Now functioning frontend
Changed some things to make trunk work
This commit is contained in:
@@ -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"] }
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|
||||||
|
|||||||
@@ -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
5
frontend/src/main.rs
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
use frontend::App;
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
yew::Renderer::<App>::new().render();
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user