未验证 提交 0d98e2ec 编写于 作者: O openharmony_ci 提交者: Gitee

!9009 LocalStorage示例接口代码修改

Merge pull request !9009 from Bo Jiang/cherry-pick-1662024781
...@@ -282,17 +282,16 @@ clear(): boolean ...@@ -282,17 +282,16 @@ clear(): boolean
import Ability from '@ohos.application.Ability' import Ability from '@ohos.application.Ability'
export default class MainAbility extends Ability { export default class MainAbility extends Ability {
storage : LocalStorage storage : LocalStorage
onCreate(want) { onCreate() {
this.storage = new LocalStorage(); this.storage = new LocalStorage();
this.storage.setOrCreate("storageSimpleProp",121); this.storage.setOrCreate("storageSimpleProp",121);
console.log("[Demo MainAbility onCreate]"); console.log("[Demo MainAbility onCreate]");
globalThis.abilityWant = want;
} }
onDestroy() { onDestroy() {
console.log("[Demo MainAbility onDestroy]") console.log("[Demo MainAbility onDestroy]")
} }
onWindowStageCreate(windowStage) { onWindowStageCreate(windowStage) {
windowStage.setUIContent(this.context,"pages/index",this.storage) windowStage.loadContent("pages/index",this.storage)
} }
onWindowStageDestroy() { onWindowStageDestroy() {
console.log("[Demo] MainAbility onWindoeStageDestroy") console.log("[Demo] MainAbility onWindoeStageDestroy")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册