initial commit

This commit is contained in:
Matt Rasmussen 2024-02-13 21:25:40 -08:00
commit d68b348fd6
6 changed files with 1940 additions and 0 deletions

5
# README.md Normal file
View File

@ -0,0 +1,5 @@
# README
```
rustup override set nightly
trunk serve --open
```

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/target
dist

1879
Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

12
Cargo.toml Normal file
View 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
View File

@ -0,0 +1,4 @@
<!DOCTYPE html>
<html>
<body></body>
</html>

38
src/main.rs Normal file
View 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>
}
});
}