| Crates.io | r2mo-webel |
| lib.rs | r2mo-webel |
| version | 0.1.1 |
| created_at | 2025-11-14 09:42:24.60887+00 |
| updated_at | 2025-11-14 14:09:16.501729+00 |
| description | Leptos component library for r2mo-web (Tailwind-ready) |
| homepage | |
| repository | https://gitee.com/silentbalanceyh/r2mo-webel |
| max_upload_size | |
| id | 1932519 |
| size | 125,142 |
Leptos-based UI component library for r2mo-web with built-in Tailwind CSS. 组件库已内置样式,使用时无需额外配置 Tailwind。
# Cargo.toml
dependencies =
leptos = { version = "0.8.12", features = ["csr"] }
r2mo-webel = { version = "0.1.0" }
在应用程序入口处初始化组件库样式:
// main.rs 或 lib.rs
use r2mo_webel::init;
fn main() {
// 初始化 r2mo-webel 组件库样式
init();
// 正常启动应用
// ...
}
或者在组件树中使用 StylesProvider 组件:
use r2mo_webel::{StylesProvider, UiButton};
#[component]
fn App() -> impl IntoView {
view! {
<StylesProvider />
<div>
<UiButton on_click=move || println!("点击了按钮")>"按钮示例"</UiButton>
</div>
}
}
class 属性传入scripts/build.sh – 完整构建脚本,包括:
scripts/gen-safelist.js – 扫描 Rust 文件生成 Tailwind CSS 类列表组件库发布时会包含:
使用标准的 cargo 发布流程:
# 构建并验证
./scripts/build.sh
# 发布到 crates.io
cargo publish