From 7655f34cf2400f421c1aa31271709717436ee151 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=9B=E4=BA=9A=E8=8A=B3?= Date: Tue, 26 Apr 2022 10:24:56 +0000 Subject: [PATCH] update en/application-dev/windowmanager/window-guidelines.md. Signed-off-by: @ge-yafang --- en/application-dev/windowmanager/window-guidelines.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/en/application-dev/windowmanager/window-guidelines.md b/en/application-dev/windowmanager/window-guidelines.md index ded781ae92..3dbbb4b740 100644 --- a/en/application-dev/windowmanager/window-guidelines.md +++ b/en/application-dev/windowmanager/window-guidelines.md @@ -25,7 +25,7 @@ Currently, the main window is automatically created when the application is star ### Creating a Subwindow You can call **create** to create a subwindow. The sample code is as follows: -``` +```js import window from '@ohos.window'; var windowClass = null; let promise = window.create("subWindow", window.WindowType.TYPE_APP); @@ -41,7 +41,7 @@ You can call **create** to create a subwindow. The sample code is as follows: - Call **getTopWindow** to obtain the top window of the application. The sample code is as follows: -``` +```js var windowClass = null; let promise = window.getTopWindow(); promise.then((data)=> { @@ -54,7 +54,7 @@ You can call **create** to create a subwindow. The sample code is as follows: - You can also call **find** to obtain created subwindows in the application. The sample code is as follows: -``` +```js var windowClass = null; let promise = window.find("subWindow"); promise.then((data)=> { @@ -69,7 +69,7 @@ You can call **create** to create a subwindow. The sample code is as follows: After a window object is obtained, you can call **hide** and **destroy** to hide and destroy the window object, respectively. The sample code is as follows: -``` +```js let promise = windowClass.hide(); promise.then((data)=> { console.info('window hidden. Data: ' + JSON.stringify(data)) @@ -91,7 +91,7 @@ After a window object is obtained, you can call **setFullScreen** to enable the The sample code is as follows: -``` +```js import window from '@ohos.window'; try { const win = await window.getTopWindow() -- GitLab