diff --git a/smart-house-web/frontend/.gitignore b/smart-house-web/frontend/.gitignore new file mode 100644 index 0000000..178135c --- /dev/null +++ b/smart-house-web/frontend/.gitignore @@ -0,0 +1 @@ +/dist/ diff --git a/smart-house-web/frontend/Cargo.toml b/smart-house-web/frontend/Cargo.toml index 1a91109..a9dcb9a 100644 --- a/smart-house-web/frontend/Cargo.toml +++ b/smart-house-web/frontend/Cargo.toml @@ -4,4 +4,5 @@ version = "0.1.0" edition = "2024" [dependencies] -leptos = { version = "0.8.19", features = ["csr"] } +console_error_panic_hook = "0.1" +leptos = { version = "0.8", features = ["csr"] } diff --git a/smart-house-web/frontend/README.md b/smart-house-web/frontend/README.md new file mode 100644 index 0000000..5ae60b0 --- /dev/null +++ b/smart-house-web/frontend/README.md @@ -0,0 +1,10 @@ +# Фронтэнд умного дома + +Запуск сервера разработки (sh): + + RUSTFLAGS="--cfg erase_components" trunk serve + +Запуск сервера разработки (powershell): + + $env:RUSTFLAGS = '--cfg erase_components' + trunk serve diff --git a/smart-house-web/frontend/src/main.rs b/smart-house-web/frontend/src/main.rs index 3bfc6b4..c0cfc82 100644 --- a/smart-house-web/frontend/src/main.rs +++ b/smart-house-web/frontend/src/main.rs @@ -1,5 +1,6 @@ use leptos::prelude::*; fn main() { + console_error_panic_hook::set_once(); leptos::mount::mount_to_body(|| view! {

"Hello, world!"

}) }