mirror of
https://github.com/leptos-rs/leptos
synced 2024-11-10 06:44:17 +00:00
Recomponentify
This commit is contained in:
parent
eb4d5abff9
commit
af5becb85b
2 changed files with 3 additions and 2 deletions
|
@ -8,6 +8,7 @@ struct CounterUpdater {
|
|||
set_counters: WriteSignal<CounterHolder>,
|
||||
}
|
||||
|
||||
#[component]
|
||||
pub fn Counters(cx: Scope) -> web_sys::Element {
|
||||
let (next_counter_id, set_next_counter_id) = cx.create_signal(0);
|
||||
let (counters, set_counters) = cx.create_signal::<CounterHolder>(vec![]);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use counters::Counters;
|
||||
use counters::{Counters, CountersProps};
|
||||
use leptos::*;
|
||||
|
||||
#[global_allocator]
|
||||
|
@ -7,5 +7,5 @@ static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
|
|||
fn main() {
|
||||
console_log::init_with_level(log::Level::Debug);
|
||||
|
||||
mount_to_body(|cx| Counters(cx))
|
||||
mount_to_body(|cx| view! { <Counters/> })
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue