提交 f5fa6af4 编写于 作者: L lyj_love_code

fix the example code

Signed-off-by: Nlyj_love_code <liangyujian2@huawei.com>
上级 0e3b35a1
......@@ -120,12 +120,12 @@
// 根据设置阈值大小去获取订阅事件包(返回的事件包对象为null,表示当前订阅数据被全部取出)
while ((eventPkg = holder.takeNext()) != null) {
// 对获取的订阅事件包进行解析,并将解析结果打印在Log界面
console.info('HiAppEvent eventPkg.packageId=' + eventPkg.packageId);
console.info('HiAppEvent eventPkg.row=' + eventPkg.row);
console.info('HiAppEvent eventPkg.size=' + eventPkg.size);
console.info(`HiAppEvent eventPkg.packageId=${eventPkg.packageId}`);
console.info(`HiAppEvent eventPkg.row=${eventPkg.row}`);
console.info(`HiAppEvent eventPkg.size=${eventPkg.size}`);
// 对订阅事件包中的事件字符串数组进行遍历解析
for (const eventInfo of eventPkg.data) {
console.info('HiAppEvent eventPkg.data=' + eventInfo);
console.info(`HiAppEvent eventPkg.data=${eventInfo}`);
}
}
}
......
......@@ -306,11 +306,11 @@ hiAppEvent.addWatcher({
}
let eventPkg = null;
while ((eventPkg = holder.takeNext()) != null) {
console.info("eventPkg.packageId=" + eventPkg.packageId);
console.info("eventPkg.row=" + eventPkg.row);
console.info("eventPkg.size=" + eventPkg.size);
console.info(`eventPkg.packageId=${eventPkg.packageId}`);
console.info(`eventPkg.row=${eventPkg.row}`);
console.info(`eventPkg.size=${eventPkg.size}`);
for (const eventInfo of eventPkg.data) {
console.info("eventPkg.data=" + eventInfo);
console.info(`eventPkg.data=${eventInfo}`);
}
}
}
......@@ -323,11 +323,11 @@ let holder = hiAppEvent.addWatcher({
if (holder != null) {
let eventPkg = null;
while ((eventPkg = holder.takeNext()) != null) {
console.info("eventPkg.packageId=" + eventPkg.packageId);
console.info("eventPkg.row=" + eventPkg.row);
console.info("eventPkg.size=" + eventPkg.size);
console.info(`eventPkg.packageId=${eventPkg.packageId}`);
console.info(`eventPkg.row=${eventPkg.row}`);
console.info(`eventPkg.size=${eventPkg.size}`);
for (const eventInfo of eventPkg.data) {
console.info("eventPkg.data=" + eventInfo);
console.info(`eventPkg.data=${eventInfo}`);
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册