Skip to content

Commit 7847492

Browse files
authored
fix: typo of codeblock in event-propagation (#529)
1 parent e913d61 commit 7847492

File tree

2 files changed

+27
-11
lines changed

2 files changed

+27
-11
lines changed

docs/en/guide/interaction/event-handling/event-propagation.mdx

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ For the client, the example is as follows:
178178

179179
<PlatformTabs queryKey="platform">
180180
<PlatformTabs.Tab platform="ios">
181+
181182
```objective-c
182183
// You can call the sendGlobalEvent function of LynxContext
183184
// The first parameter is the event name monitored by the front end, and the second parameter is the data received by the front end
@@ -188,19 +189,25 @@ For the client, the example is as follows:
188189
</PlatformTabs.Tab>
189190
190191
<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); ```
192+
193+
```java
194+
// You can call the sendGlobalEvent function of LynxContext
195+
// The first parameter is the event name monitored by the front end, and the second parameter is the data received by the front end
196+
LynxContext.sendGlobalEvent("eventName", args);
197+
// Or call the sendGlobalEvent function of LynxView
198+
LynxView.sendGlobalEvent("eventName", args);
199+
```
200+
196201
</PlatformTabs.Tab>
197202

198203
<PlatformTabs.Tab platform="harmony">
204+
199205
```js
200206
// You can call the sendGlobalEvent function of LynxContext
201207
// 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);
208+
LynxContext.sendGlobalEvent('eventName', args);
203209
```
210+
204211
</PlatformTabs.Tab>
205212
</PlatformTabs>
206213

docs/zh/guide/interaction/event-handling/event-propagation.mdx

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,28 +178,37 @@ 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);
198+
// 或者调用 LynxView 的sendGlobalEvent 函数
199+
LynxView.sendGlobalEvent("eventName", args);
200+
```
201+
195202
</PlatformTabs.Tab>
196203

197204
<PlatformTabs.Tab platform="harmony">
205+
198206
```js
199207
// 可以调用 LynxContext 的 sendGlobalEvent 函数
200208
// 第一个参数为前端监听的事件名称,第二个参数为前端接收到的数据
201-
LynxContext.sendGlobalEvent("eventName", args);
209+
LynxContext.sendGlobalEvent('eventName', args);
202210
```
211+
203212
</PlatformTabs.Tab>
204213
</PlatformTabs>
205214

0 commit comments

Comments
 (0)