Minor Bugfixes
This commit is contained in:
30
frontend/src/pages/basic_pages.rs
Normal file
30
frontend/src/pages/basic_pages.rs
Normal file
@@ -0,0 +1,30 @@
|
||||
use yew::prelude::*;
|
||||
|
||||
#[component(Home)]
|
||||
pub fn home_component() -> Html {
|
||||
let counter = use_state(|| 0);
|
||||
let onclick = {
|
||||
let counter = counter.clone();
|
||||
move |_| {
|
||||
let value = *counter + 1;
|
||||
counter.set(value);
|
||||
}
|
||||
};
|
||||
|
||||
html! {
|
||||
<div>
|
||||
<button {onclick}>{ "+1" }</button>
|
||||
<p>{ *counter }</p>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
#[component(NotFound)]
|
||||
pub fn not_found_component() -> Html {
|
||||
let message = "404 Not found";
|
||||
html! {
|
||||
<div>
|
||||
<h1>{&message}</h1>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
1
frontend/src/pages/mod.rs
Normal file
1
frontend/src/pages/mod.rs
Normal file
@@ -0,0 +1 @@
|
||||
pub mod basic_pages;
|
||||
Reference in New Issue
Block a user