diff --git a/zh-cn/application-dev/windowmanager/window-guidelines.md b/zh-cn/application-dev/windowmanager/window-guidelines.md index fa53347833b063a3bef04ab5e1337447aa0073da..7193fd0a488ae9c4b5bc03ac7394377e84590147 100644 --- a/zh-cn/application-dev/windowmanager/window-guidelines.md +++ b/zh-cn/application-dev/windowmanager/window-guidelines.md @@ -95,14 +95,12 @@ ``` import window from '@ohos.window'; -.onClick(async () => { - try { - const win = await window.getTopWindow() - await win.setFullScreen(true) - } catch (err) { - console.log(`setFullScreen fail, code = ${err.code}`) - } -}) +try { + const win = await window.getTopWindow() + await win.setFullScreen(true) +} catch (err) { + console.log(`setFullScreen fail, code = ${err.code}`) +} ``` 完整[示例工程](https://gitee.com/openharmony/windowmanager/tree/master/AppDemo/window/immersive)。