Extend head components with global attributes (#2888)

* Fix hot reloading components with keys

* include component formatted segment keys, but not dynamic component value

* extend each head component with the corresponding element

* Allow spreading custom attributes into components

* Fix component_literal_dyn_idx index

* add a new test for hot reloading components with keys

* FIx script without body warning and rendering styles with a href set

* fix clippy
This commit is contained in:
Evan Almloff authored and GitHub committed 2024-10-01 10:24:22 -05:00
1 parent c2b131f249
commit 95976d9a17
8 files changed
+863 -1134

No files matched your search

+8 -8
View File
@@ -1017,21 +1017,21 @@ Finally, call `.build()` to create the instance of `{name}`.
impl #impl_generics dioxus_core::prelude::HasAttributes for #builder_name < #( #ty_generics ),* > #where_clause {
fn push_attribute(
mut self,
name: &'static str,
ns: Option<&'static str>,
attr: impl dioxus_core::prelude::IntoAttributeValue,
volatile: bool
____name: &'static str,
____ns: Option<&'static str>,
____attr: impl dioxus_core::prelude::IntoAttributeValue,
____volatile: bool
) -> Self {
let ( #(#descructuring,)* ) = self.fields;
self.#field_name.push(
dioxus_core::Attribute::new(
name,
____name,
{
use dioxus_core::prelude::IntoAttributeValue;
attr.into_value()
____attr.into_value()
},
ns,
volatile,
____ns,
____volatile,
)
);
#builder_name {