Macro dominator::shadow_root
source · macro_rules! shadow_root { ($this:ident, $mode:expr => { $($methods:tt)* }) => { ... }; }
Expand description
Attaches a shadow root to a DomBuilder
.
The first argument is the shadow root mode (ShadowRootMode::Open
or ShadowRootMode::Closed
).
The second argument is a block of method calls. Inside of the block you can use DomBuilder<web_sys::ShadowRoot>
methods:
use web_sys::ShadowRootMode;
html!("div", {
.shadow_root!(ShadowRootMode::Open, {
.child(...)
.child_signal(...)
.children_signal_vec(...)
})
})
The method calls are applied to the shadow root, not the parent DomBuilder
.
The block uses the apply_methods!
macro, see the docs for apply_methods!
for more details.