提交 b7b6fe61 编写于 作者: L lixia

窗口arkts 告警修复

Signed-off-by: Nlixia <lixia110@huawei.com>
上级 b33f3138
...@@ -41,12 +41,13 @@ onConnect(want: Want): void ...@@ -41,12 +41,13 @@ onConnect(want: Want): void
**示例:** **示例:**
```ts ```ts
export default class MyWindowExtensionAbility extends WindowExtensionAbility { import WindowExtensionAbility from '@ohos.application.WindowExtensionAbility';
import Want from '@ohos.app.ability.Want';
onConnect(want) { export default class MyWindowExtensionAbility extends WindowExtensionAbility {
onConnect(want: Want) {
console.info('WindowExtAbility onConnect, abilityName: ${want.abilityName}'); console.info('WindowExtAbility onConnect, abilityName: ${want.abilityName}');
} }
} }
``` ```
...@@ -68,12 +69,13 @@ onDisconnect(want: Want): void ...@@ -68,12 +69,13 @@ onDisconnect(want: Want): void
**示例:** **示例:**
```ts ```ts
export default class MyWindowExtensionAbility extends WindowExtensionAbility { import WindowExtensionAbility from '@ohos.application.WindowExtensionAbility';
import Want from '@ohos.app.ability.Want';
onDisconnect(want) { export default class MyWindowExtensionAbility extends WindowExtensionAbility {
onDisconnect(want: Want) {
console.info('WindowExtAbility onDisconnect, abilityName: ${want.abilityName}'); console.info('WindowExtAbility onDisconnect, abilityName: ${want.abilityName}');
} }
} }
``` ```
...@@ -95,16 +97,20 @@ onWindowReady(window: window.Window): void ...@@ -95,16 +97,20 @@ onWindowReady(window: window.Window): void
**示例:** **示例:**
```ts ```ts
import WindowExtensionAbility from '@ohos.application.WindowExtensionAbility';
import window from '@ohos.window';
let windowStage: window.WindowStage | null = null
export default class MyWindowExtensionAbility extends WindowExtensionAbility { export default class MyWindowExtensionAbility extends WindowExtensionAbility {
onWindowReady(windowClass: window.Window) {
onWindowReady(window) { windowStage!.loadContent('WindowExtAbility/pages/index1').then(() => {
window.loadContent('WindowExtAbility/pages/index1').then(() => { windowClass.getProperties().then((pro: window.WindowProperties) => {
window.getProperties().then((pro) => {
console.log('WindowExtension pro: ${JSON.stringify(pro)}'); console.log('WindowExtension pro: ${JSON.stringify(pro)}');
}); });
window.show(); windowClass.show();
}); });
} }
} }
``` ```
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册