Admin
This commit is contained in:
parent
a9d223d976
commit
ac49905e0b
@ -1,43 +0,0 @@
|
||||
[package]
|
||||
name = "web"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib", "rlib"]
|
||||
name = "web"
|
||||
path = "src/lib.rs"
|
||||
|
||||
[dependencies]
|
||||
|
||||
[dependencies.serde]
|
||||
version = "1.0.140"
|
||||
features = ['derive']
|
||||
|
||||
[dependencies.stdweb]
|
||||
version = "0.4.20"
|
||||
features = []
|
||||
|
||||
[dependencies.stdweb-derive]
|
||||
version = "0.5.3"
|
||||
features = []
|
||||
|
||||
[dependencies.stdweb-logger]
|
||||
version = "0.1.1"
|
||||
features = []
|
||||
|
||||
#[dependencies.wasm-bindgen]
|
||||
#version = "0.2.81"
|
||||
#features = []
|
||||
#
|
||||
#[dependencies.web-sys]
|
||||
#version = "0.3.58"
|
||||
#features = ['HtmlElement']
|
||||
#
|
||||
#[dependencies.js-sys]
|
||||
#version = "0.3.58"
|
||||
#features = []
|
||||
|
||||
[dependencies.wee_alloc]
|
||||
version = "*"
|
||||
features = ["static_array_backend"]
|
@ -1,65 +0,0 @@
|
||||
use wasm_bindgen::prelude::*;
|
||||
use web_sys::HtmlElement;
|
||||
|
||||
#[global_allocator]
|
||||
static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
|
||||
|
||||
pub trait Component {
|
||||
fn tag_name() -> String;
|
||||
|
||||
fn created(&mut self) {}
|
||||
|
||||
fn connected_callback(&self) {}
|
||||
|
||||
fn disconnected_callback(&mut self) {}
|
||||
|
||||
fn attribute_changed(
|
||||
&mut self,
|
||||
_name: String,
|
||||
_old_value: Option<String>,
|
||||
_new_value: Option<String>,
|
||||
) {
|
||||
}
|
||||
}
|
||||
|
||||
#[wasm_bindgen(extends = web_sys::HtmlElement, extends = web_sys::Object)]
|
||||
pub struct FooElement {
|
||||
el: HtmlElement,
|
||||
}
|
||||
|
||||
#[wasm_bindgen]
|
||||
impl FooElement {
|
||||
#[wasm_bindgen]
|
||||
pub fn tag_name() -> String {
|
||||
"foo-element".into()
|
||||
}
|
||||
|
||||
#[wasm_bindgen(constructor)]
|
||||
pub fn new(el: HtmlElement) -> Self {
|
||||
Self { el }
|
||||
}
|
||||
|
||||
#[wasm_bindgen(js_name = connectedCallback)]
|
||||
pub fn connected_callback(&self) {}
|
||||
}
|
||||
|
||||
#[wasm_bindgen(extends = web_sys::HtmlElement, extends = web_sys::Object)]
|
||||
pub struct BarElement {
|
||||
el: HtmlElement,
|
||||
}
|
||||
|
||||
#[wasm_bindgen]
|
||||
impl BarElement {
|
||||
#[wasm_bindgen]
|
||||
pub fn tag_name() -> String {
|
||||
"bar-element".into()
|
||||
}
|
||||
|
||||
#[wasm_bindgen(constructor)]
|
||||
pub fn new(el: HtmlElement) -> Self {
|
||||
Self { el }
|
||||
}
|
||||
|
||||
#[wasm_bindgen(js_name = connectedCallback)]
|
||||
pub fn connected_callback(&self) {}
|
||||
}
|
@ -1 +0,0 @@
|
||||
|
Loading…
Reference in New Issue
Block a user