initial commit
This commit is contained in:
commit
d68b348fd6
5
# README.md
Normal file
5
# README.md
Normal file
@ -0,0 +1,5 @@
|
||||
# README
|
||||
```
|
||||
rustup override set nightly
|
||||
trunk serve --open
|
||||
```
|
||||
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
/target
|
||||
dist
|
||||
1879
Cargo.lock
generated
Normal file
1879
Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
12
Cargo.toml
Normal file
12
Cargo.toml
Normal file
@ -0,0 +1,12 @@
|
||||
[package]
|
||||
name = "monhun-inventory"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
async-trait = "0.1.77"
|
||||
console_error_panic_hook = "0.1.7"
|
||||
leptos = { version = "0.6.5", features = ["csr", "nightly"] }
|
||||
leptos-struct-table = "0.7.0"
|
||||
4
index.html
Normal file
4
index.html
Normal file
@ -0,0 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body></body>
|
||||
</html>
|
||||
38
src/main.rs
Normal file
38
src/main.rs
Normal file
@ -0,0 +1,38 @@
|
||||
use leptos::*;
|
||||
use leptos_struct_table::*;
|
||||
|
||||
#[derive(TableRow, Clone, Debug)]
|
||||
#[table(impl_vec_data_provider,
|
||||
sortable,
|
||||
)]
|
||||
pub struct Item {
|
||||
#[table(skip)]
|
||||
id: u32,
|
||||
name: String,
|
||||
}
|
||||
|
||||
impl Item {
|
||||
fn new(id:u32, name:String) -> Self {
|
||||
Self { id, name}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
console_error_panic_hook::set_once();
|
||||
|
||||
mount_to_body(|| {
|
||||
let rows = vec![
|
||||
Item::new( 1, "One".to_string()),
|
||||
Item::new( 2, "Two".to_string()),
|
||||
Item::new( 3, "Three".to_string()),
|
||||
];
|
||||
|
||||
view! {
|
||||
<div>
|
||||
<table>
|
||||
<TableContent rows=rows />
|
||||
</table>
|
||||
</div>
|
||||
}
|
||||
});
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user