小编And*_*eas的帖子

如何监听子元素的 Shadow dom 中触发的事件?

我有两个网络组件,一个类似于列表项,另一个是容器。在列表项中有一个按钮,它调度 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)

如何在“自定义列表”中侦听“自定义列表项”中的按钮发出的事件?

html javascript web-component shadow-dom

6
推荐指数
1
解决办法
7299
查看次数

标签 统计

html ×1

javascript ×1

shadow-dom ×1

web-component ×1