開発者は、検索を行う Lightning Web コンポーネントを構築しています。 連絡先用。コンポーネントは検索を伝達する必要があります 結果は、他の無関係な Lightning Web コンポーネントに送信されます。 検索が完了すると、異なる DOM ツリーが表示されます。 通信を実装するには開発者は何をすべきでしょうか?
正解:D
For communication between unrelated Lightning web components that are in different DOM trees, the most suitable approach is to use the Lightning Message Service (LMS). This service allows components to communicate with each other using a message channel, which is particularly useful when the components are not in the same containment hierarchy. By publishing and subscribing to messages on a message channel, components can exchange data and notifications, which is ideal for the scenario described. References: Lightning Web Components Developer Guide - Communicate Across the DOM with Lightning Message Service