提交 28348a01 编写于 作者: B bojiang

jiangbo91@huawei.com

修改localStorage示例代码接口
Signed-off-by: Nbojiang <jiangbo91@huawei.com>
Change-Id: I3793109b1ff3fda2c0cfa2b0eaeafa23f67c5c1e
上级 1f8ef942
......@@ -170,8 +170,8 @@ setAndLink\<T>(propName: string, defaultValue: T): T
**返回值:**
| 类型 | 描述 |
| ------------------------------------- | ---------------------------------------- |
| [@Link](ts-component-states-link.md ) | 与Link接口类似,如果当前的key保存于LocalStorage,返回该key值对应的value值。如果该key值未被创建,则创建一个对应的defaultValue的Link返回。 |
| ------------------------------------ | ------------------------------------------------------------ |
| [@Link](ts-component-states-link.md) | 与Link接口类似,如果当前的key保存于LocalStorage,返回该key值对应的value值。如果该key值未被创建,则创建一个对应的defaultValue的Link返回。 |
......@@ -286,13 +286,12 @@ export default class MainAbility extends Ability {
this.storage = new LocalStorage();
this.storage.setOrCreate("storageSimpleProp",121);
console.log("[Demo MainAbility onCreate]");
globalThis.abilityWant = want;
}
onDestroy() {
console.log("[Demo MainAbility onDestroy]")
}
onWindowStageCreate(windowStage) {
windowStage.setUIContent(this.context,"pages/index",this.storage)
windowStage.loadContent("pages/index",this.storage)
}
onWindowStageDestroy() {
console.log("[Demo] MainAbility onWindoeStageDestroy")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册