diff --git a/zh-cn/application-dev/reference/apis/js-apis-WorkSchedulerExtensionAbility.md b/zh-cn/application-dev/reference/apis/js-apis-WorkSchedulerExtensionAbility.md index 337f7f8bfb347f73f6def59e57323a61507665e0..6b01338735b5e45aa40ab86888b87ca162e9bd10 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-WorkSchedulerExtensionAbility.md +++ b/zh-cn/application-dev/reference/apis/js-apis-WorkSchedulerExtensionAbility.md @@ -12,7 +12,6 @@ ```ts import WorkSchedulerExtensionAbility from '@ohos.WorkSchedulerExtensionAbility'; -import workScheduler from '@ohos.resourceschedule.workScheduler'; ``` ## 属性 @@ -40,11 +39,13 @@ onWorkStart(work: workScheduler.WorkInfo): void **示例:** ```ts - export default class MyWorkSchedulerExtensionAbility extends WorkSchedulerExtensionAbility { - onWorkStart(workInfo: workScheduler.WorkInfo) { - console.log('MyWorkSchedulerExtensionAbility onWorkStart' + JSON.stringify(workInfo)); - } + import workScheduler from '@ohos.resourceschedule.workScheduler'; + + export default class MyWorkSchedulerExtensionAbility extends WorkSchedulerExtensionAbility { + onWorkStart(workInfo: workScheduler.WorkInfo) { + console.log('MyWorkSchedulerExtensionAbility onWorkStart' + JSON.stringify(workInfo)); } + } ``` ## WorkSchedulerExtensionAbility.onWorkStop @@ -65,9 +66,11 @@ onWorkStop(work: workScheduler.WorkInfo): void **示例:** ```ts - export default class MyWorkSchedulerExtensionAbility extends WorkSchedulerExtensionAbility { - onWorkStop(workInfo: workScheduler.WorkInfo) { - console.log('MyWorkSchedulerExtensionAbility onWorkStop' + JSON.stringify(workInfo)); - } + import workScheduler from '@ohos.resourceschedule.workScheduler'; + + export default class MyWorkSchedulerExtensionAbility extends WorkSchedulerExtensionAbility { + onWorkStop(workInfo: workScheduler.WorkInfo) { + console.log('MyWorkSchedulerExtensionAbility onWorkStop' + JSON.stringify(workInfo)); } + } ``` \ No newline at end of file