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

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

Signed-off-by: N葛亚芳 <geyafang@huawei.com>
上级 6a9e0d38
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
| 实例名 | 接口名 | 描述 | | 实例名 | 接口名 | 描述 |
| -------- | -------- | -------- | | -------- | -------- | -------- |
| window静态方法 | createWindow(config: Configuration, callback: AsyncCallback\<Window>): void | 创建子窗口。<br/>-`config`:创建窗口时的参数。 | | window静态方法 | createWindow(config: Configuration, callback: AsyncCallback\<Window>): void | 创建子窗口。<br/>-`config`:创建窗口时的参数。 |
| window静态方法 | findWindow(id: string, callback: AsyncCallback&lt;Window&gt;): void | 查找`id`所对应的窗口。 | | window静态方法 | findWindow(name: string): Window | 查找`name`所对应的窗口。 |
| Window | SetUIContent(path: string, callback: AsyncCallback&lt;void&gt;): void | 为当前窗口加载具体页面内容。 | | Window | SetUIContent(path: string, callback: AsyncCallback&lt;void&gt;): void | 为当前窗口加载具体页面内容。 |
| Window | moveWindowTo(x: number, y: number, callback: AsyncCallback&lt;void&gt;): void | 移动当前窗口。 | | Window | moveWindowTo(x: number, y: number, callback: AsyncCallback&lt;void&gt;): void | 移动当前窗口。 |
| Window | setWindowBackgroundColor(color: string, callback: AsyncCallback&lt;void&gt;): void | 设置窗口的背景色。 | | Window | setWindowBackgroundColor(color: string, callback: AsyncCallback&lt;void&gt;): void | 设置窗口的背景色。 |
...@@ -64,14 +64,11 @@ ...@@ -64,14 +64,11 @@
windowClass = data; windowClass = data;
}); });
// 方式二:查找得到子窗口。 // 方式二:查找得到子窗口。
window.findWindow("subWindow", (err, data) => { try {
if (err.code) { windowClass = window.findWindow('subWindow');
console.error('Failed to find the subWindow. Cause: ' + JSON.stringify(err)); } catch (exception) {
return; console.error('Failed to find the Window. Cause: ' + JSON.stringify(exception));
} }
console.info('Succeeded in finding subWindow. Data: ' + JSON.stringify(data));
windowClass = data;
});
``` ```
2. 设置子窗口属性。 2. 设置子窗口属性。
...@@ -156,7 +153,7 @@ ...@@ -156,7 +153,7 @@
let mainWindowClass = null; let mainWindowClass = null;
// 获取主窗口。 // 获取主窗口。
window.getLastWindow((err, data) => { window.getLastWindow(this.context,(err, data) => {
if (err.code) { if (err.code) {
console.error('Failed to get the subWindow. Cause: ' + JSON.stringify(err)); console.error('Failed to get the subWindow. Cause: ' + JSON.stringify(err));
return; return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册