未验证 提交 92082535 编写于 作者: B Bo Jiang 提交者: Gitee

update zh-cn/release-notes/changelogs/OpenHarmony_4.0.8.2/changelogs-arkui.md.

Signed-off-by: NBo Jiang <jiangbo91@huawei.com>
上级 58fbd1d4
...@@ -44,27 +44,43 @@ struct DatePickerExample { ...@@ -44,27 +44,43 @@ struct DatePickerExample {
**示例:** **示例:**
```ts ```ts
let NextID: number = 0;
@Observed
class ClassA {
public id: number;
public c: number;
constructor(c: number) {
this.id = NextID++;
this.c = c;
}
}
@Entry @Entry
@Component @Component
struct LocalStorageComponent { struct LocalStorageComponent {
build() { build() {
Column() { Column() {
Child({ Child({
/* ArkTS:ERROR Property 'simpleVarName' in the custom component 'Child' cannot /* ArkTS:ERROR Property 'simpleVarName' in the custom component 'Child' cannot
initialize here (forbidden to specify). */ initialize here (forbidden to specify). */
simpleVarName: 1, simpleVarName: 1,
/* ArkTS:ERROR Property 'objectName' in the custom component 'Child' cannot /* ArkTS:ERROR Property 'objectName' in the custom component 'Child' cannot
initialize here (forbidden to specify). */ initialize here (forbidden to specify). */
objectName: new ClassA("x") objectName: new ClassA(1)
}) })
}
} }
}
} }
@Component @Component
struct Child { struct Child {
@LocalStorageLink("storageSimpleProp") simpleVarName: number = 0; @LocalStorageLink("storageSimpleProp") simpleVarName: number = 0;
@LocalStorageProp("storageObjectProp") objectName: ClassA = new ClassA("x"); @LocalStorageProp("storageObjectProp") objectName: ClassA = new ClassA(1);
build() {}
build() {
}
} }
``` ```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册