Skip to main content

test_attr_attr

Function test_attr_attr 

Source
pub fn test_attr_attr(
    test_attr: Option<TestAttr>,
) -> impl CustomAttribute<String, String>
Expand description

Helper to apply an optional TestAttr to a Leptos element.

Usage in view!:

<div attr:..=test_attr_attr(test_attr)>
  ...
</div>

When test_attr is:

  • None => no attribute is rendered
  • Some(TestAttr { key, value }) => renders key="value".