feat(build): generate client handler bootstrap
req: client_local/001\nreq: client_local/004\nreq: client_local/006\nreq: client_local/007\nreq: client_local/008\nreq: client_local/009\nreq: client_local/010\nreq: client_local/014\nreq: security/002\nreq: security/006\nreq: v1_release/001\nreq: v1_release/008
This commit is contained in:
@@ -4,9 +4,18 @@ version.workspace = true
|
||||
edition.workspace = true
|
||||
publish = false
|
||||
|
||||
[features]
|
||||
default = []
|
||||
fixture = []
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib", "rlib"]
|
||||
|
||||
[[bin]]
|
||||
name = "fixture"
|
||||
path = "src/bin/fixture.rs"
|
||||
required-features = ["fixture"]
|
||||
|
||||
[dependencies]
|
||||
hemx = { path = "../../hemx", features = ["client"] }
|
||||
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
fn main() {
|
||||
print!("{}", hemx_client_local_example::render_fixture());
|
||||
}
|
||||
@@ -1,6 +1,15 @@
|
||||
#[hemx::surface]
|
||||
pub mod ui {}
|
||||
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[derive(hemplate::Hemplate)]
|
||||
pub struct ClientLocal;
|
||||
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
pub fn render_fixture() -> hemx::Html {
|
||||
ui::client_local::render(&ClientLocal)
|
||||
}
|
||||
|
||||
#[hemx::handler(client)]
|
||||
pub fn increment(
|
||||
event: hemx::wasm::ClientEvent,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<main data-hemx-root="client_local" data-hemx-st="count=3" data-hemx-client-state-version="1">
|
||||
<main data-hemx-root="client_local" data-hemx-st="count=3" data-hemx-client-state-version="1" data-hemx-client-module="/client_local.js">
|
||||
<section data-hemx-slot="counter_panel">idle</section>
|
||||
<button type="button" data-hemx-handle="increment" data-hemx-on="click" data-hemx-client="increment" data-hemx-client-fallback data-hemx-pending-class="is-pending">Increment locally</button>
|
||||
</main>
|
||||
|
||||
Reference in New Issue
Block a user