File tree Expand file tree Collapse file tree 2 files changed +21
-10
lines changed
en/guide/interaction/event-handling
zh/guide/interaction/event-handling Expand file tree Collapse file tree 2 files changed +21
-10
lines changed Original file line number Diff line number Diff line change @@ -188,19 +188,24 @@ For the client, the example is as follows:
188188</PlatformTabs.Tab>
189189
190190<PlatformTabs.Tab platform="android">
191- ```java // You can call the sendGlobalEvent function of LynxContext // The
192- first parameter is the event name monitored by the front end, and the second
193- parameter is the data received by the front end
194- LynxContext.sendGlobalEvent("eventName", args); // Or call the sendGlobalEvent
195- function of LynxView LynxView.sendGlobalEvent("eventName", args); ```
191+
192+ ```java
193+ // You can call the sendGlobalEvent function of LynxContext
194+ // The first parameter is the event name monitored by the front end, and the second parameter is the data received by the front end
195+ LynxContext.sendGlobalEvent("eventName", args); // Or call the sendGlobalEvent function of LynxView
196+ LynxView.sendGlobalEvent("eventName", args);
197+ ```
198+
196199</PlatformTabs.Tab >
197200
198201<PlatformTabs.Tab platform = " harmony" >
202+
199203``` js
200204// You can call the sendGlobalEvent function of LynxContext
201205// The first parameter is the event name monitored by the front end, and the second parameter is the data received by the front end
202- LynxContext.sendGlobalEvent(" eventName" , args);
206+ LynxContext .sendGlobalEvent (' eventName' , args);
203207```
208+
204209</PlatformTabs.Tab >
205210</PlatformTabs >
206211
Original file line number Diff line number Diff line change @@ -178,20 +178,26 @@ import { PlatformTabs, Go } from '@lynx';
178178
179179<PlatformTabs queryKey = " platform" >
180180<PlatformTabs.Tab platform = " ios" >
181+
181182``` objective-c
182183// 可以调用 LynxContext 的 sendGlobalEvent 函数
183184// 第一个参数为前端监听的事件名称,第二个参数为前端接收到的数据
184185[LynxContext sendGlobalEvent: @"eventName" withParams:args] ;
185186// 或者调用 LynxView 的 sendGlobalEvent 函数
186187[ LynxView sendGlobalEvent:@"eventName" withParams:args] ;
187188```
189+
188190</PlatformTabs.Tab>
189191
190192<PlatformTabs.Tab platform="android">
191- ```java // 可以调用 LynxContext 的 sendGlobalEvent 函数 //
192- 第一个参数为前端监听的事件名称,第二个参数为前端接收到的数据
193- LynxContext.sendGlobalEvent("eventName", args); // 或者调用 LynxView
194- 的sendGlobalEvent 函数 LynxView.sendGlobalEvent("eventName", args); ```
193+
194+ ```java
195+ // 可以调用 LynxContext 的 sendGlobalEvent 函数
196+ // 第一个参数为前端监听的事件名称,第二个参数为前端接收到的数据
197+ LynxContext.sendGlobalEvent("eventName", args); // 或者调用 LynxView 的sendGlobalEvent 函数
198+ LynxView.sendGlobalEvent("eventName", args);
199+ ```
200+
195201</PlatformTabs.Tab >
196202
197203<PlatformTabs.Tab platform = " harmony" >
You can’t perform that action at this time.
0 commit comments