26 lines
539 B
Rust
26 lines
539 B
Rust
use wasm_bindgen::prelude::*;
|
|
use yew::prelude::*;
|
|
|
|
pub struct Canvas {}
|
|
|
|
impl Component for Canvas {
|
|
type Message = ();
|
|
type Properties = ();
|
|
|
|
fn create(_: Self::Properties, _: ComponentLink<Self>) -> Self {
|
|
Self {}
|
|
}
|
|
|
|
fn update(&mut self, _: Self::Message) -> ShouldRender {
|
|
true
|
|
}
|
|
|
|
fn change(&mut self, _: Self::Properties) -> ShouldRender {
|
|
false
|
|
}
|
|
|
|
fn view(&self) -> Html {
|
|
html! { <canvas width="800" height="300" style="border: 1px solid grey"></canvas> }
|
|
}
|
|
}
|