Crates.io | leptos_element_plus |
lib.rs | leptos_element_plus |
version | 0.0.6 |
source | src |
created_at | 2023-11-04 18:38:20.739799 |
updated_at | 2023-12-18 09:35:30.135908 |
description | A wrapper of element-plus for leptos |
homepage | |
repository | |
max_upload_size | |
id | 1025373 |
size | 1,164,324 |
A wrapper of Element Plus for Leptos.
Explore the combination of Vue components with Leptos,it’s simply for the sake of reusing the wheel.
mod app;
use leptos::*;
use leptos_meta::provide_meta_context;
use app::*;
use leptos_element_plus::ElementPlusSetup;
fn main() {
_ = console_log::init_with_level(log::Level::Debug);
provide_meta_context();
mount_to_body(|| {
view! {
<ElementPlusSetup/>
<App/>
}
})
}
use leptos::*;
use leptos::logging::log;
use js_sys::Date;
use leptos_element_plus::components::el_date_time_picker::DateTimePicker;
#[component]
pub fn App() -> impl IntoView {
let date = create_rw_signal(Date::new_0());
create_effect(move|_| {
log!("date: {:?}", date.get().to_string());
});
view! {
<div class="flex flex-col p-6 space-y-4">
<DateTimePicker
value=date
placeholder="Select date and time"
/>
</div>
}
}