提交 7b1a54b1 编写于 作者: L leafly2021

fixed 00e28872 from https://gitee.com/leafly2021/docs/pulls/11106

modify window demo destroy
Signed-off-by: Nleafly2021 <figo.yefei@huawei.com>
Change-Id: I743329073ca241460c1766531dfbbf2d6f618b70
上级 15a1b81c
......@@ -377,16 +377,13 @@ class MainAbility extends Ability {
console.info('Succeeded in showing the window. Data: ' + JSON.stringify(data));
});
});
//5.销毁悬浮窗。当不再需要悬浮窗时,可根据具体实现逻辑,使用destroy对其进行销毁,此处以监听窗口区域外的点击事件为例实现悬浮窗的销毁。
windowClass.on('touchOutside', () => {
console.info('touch outside');
windowClass.destroy((err, data) => {
if (err.code) {
console.error('Failed to destroy the window. Cause: ' + JSON.stringify(err));
return;
}
console.info('Succeeded in destroying the window. Data: ' + JSON.stringify(data));
});
//5.销毁悬浮窗。当不再需要悬浮窗时,可根据具体实现逻辑,使用destroy对其进行销毁。
windowClass.destroy((err, data) => {
if (err.code) {
console.error('Failed to destroy the window. Cause: ' + JSON.stringify(err));
return;
}
console.info('Succeeded in destroying the window. Data: ' + JSON.stringify(data));
});
});
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册