未验证 提交 b3434afb 编写于 作者: 葛亚芳 提交者: Gitee

update zh-cn/application-dev/windowmanager/application-window-stage.md.

Signed-off-by: N葛亚芳 <geyafang@huawei.com>
上级 4c842045
...@@ -178,16 +178,13 @@ class MainAbility extends Ability { ...@@ -178,16 +178,13 @@ class MainAbility extends Ability {
console.info('Succeeded in showing the window. Data: ' + JSON.stringify(data)); console.info('Succeeded in showing the window. Data: ' + JSON.stringify(data));
}); });
}); });
// 4.销毁子窗口。当不再需要子窗口时,可根据具体实现逻辑,使用destroy对其进行销毁,此处以监听窗口区域外的点击事件为例实现子窗口的销毁。 // 4.销毁子窗口。当不再需要子窗口时,可根据具体实现逻辑,使用destroy对其进行销毁。
sub_windowClass.on('touchOutside', () => { sub_windowClass.destroy((err, data) => {
console.info('touch outside'); if (err.code) {
sub_windowClass.destroy((err, data) => { console.error('Failed to destroy the window. Cause: ' + JSON.stringify(err));
if (err.code) { return;
console.error('Failed to destroy the window. Cause: ' + JSON.stringify(err)); }
return; console.info('Succeeded in destroying the window. Data: ' + JSON.stringify(data));
}
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.
先完成此消息的编辑!
想要评论请 注册