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

!9463 LocalStorage文档优化

Merge pull request !9463 from Bo Jiang/cherry-pick-1663158915
......@@ -278,6 +278,8 @@ clear(): boolean
### 示例1(在一个Ability创建的LocalStorage)
LocalStorage通过loadContent接口加载,接口详见[loadContent](../reference/apis/js-apis-window.md#loadcontent9-1)
```ts
import Ability from '@ohos.application.Ability'
export default class MainAbility extends Ability {
......@@ -291,6 +293,7 @@ export default class MainAbility extends Ability {
console.log("[Demo MainAbility onDestroy]")
}
onWindowStageCreate(windowStage) {
// storage作为参数传递给loadContent接口。
windowStage.loadContent("pages/index",this.storage)
}
onWindowStageDestroy() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册