Add initial_value attribute & fix static special attribute handling (#1063)

* feat & fix: initial_value attribute, special attribute handling

* revision: rename js file

* fix: rustfmt

* fix: clippy

* fix: desktop not finding common.js

* fix: desktop failing to render

Missed a single ``this.SetAttributeInner`` as it was now ``setAttributeInner``
Javascript didn't even throw any errors about this smh

* revision: no need for match statement
This commit is contained in:
Miles Murgaw authored and GitHub committed 2023-06-04 11:29:34 -05:00
1 parent 0f684f0567
commit d09c92beda
9 files changed
+82 -18

No files matched your search

+7 -2
View File
@@ -1,4 +1,4 @@
use dioxus_interpreter_js::INTERPRETER_JS;
use dioxus_interpreter_js::{COMMON_JS, INTERPRETER_JS};
use std::{
borrow::Cow,
path::{Path, PathBuf},
@@ -37,7 +37,7 @@ fn module_loader(root_name: &str) -> String {
);
format!(
r#"
<script>
<script type="module">
{js}
let rootname = "{root_name}";
@@ -84,6 +84,11 @@ pub(super) fn desktop_handler(
.header("Content-Type", "text/html")
.body(Cow::from(body))
.map_err(From::from);
} else if request.uri().path() == "/common.js" {
return Response::builder()
.header("Content-Type", "text/javascript")
.body(Cow::from(COMMON_JS.as_bytes()))
.map_err(From::from);
}
// Else, try to serve a file from the filesystem.