我希望在Web应用程序的多个位置使用刺激控制器。我想做类似于这样的事情:
<div data-controller="mycontroller">
<OneComponent />
</div>
<SomeOtherComponent />
<div data-controller="mycontroller">
<NewComponent />
</div>
但是控制器似乎只连接到了第一个组件,而没有连接到第二个组件。我打算的用法可行吗?
谢谢!
connect()
函数中只打印了第一个组件。 - Rafael Mora