我有两个网络组件,一个类似于列表项,另一个是容器。在列表项中有一个按钮,它调度 onclick 事件。两个组件都使用独立的 Shadow-dom。
<custom-list>
<custom-list-item></custom-list-item>
<custom-list-item></custom-list-item>
<custom-list-item></custom-list-item>
</custom-list>
Run Code Online (Sandbox Code Playgroud)
如何在“自定义列表”中侦听“自定义列表项”中的按钮发出的事件?