I have an LWC that wraps other child LWCs via a slot
:
<template>
...
<div class="sections-content-container">
...
<slot></slot>
...
and would like to execute a method on each child LWC, guarded by a duck typing check typeof child.save === "function"
. But when I this.template.querySelector('slot')
the child LWCs are not available.
(This is a variation of Call Methods on Child Components where no slots are used.)
Is there a pattern that can accomplish this, short of broadcasting a LMS message?