From 2649cf91fc183cc45ec75241c2028136251333b4 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Mon, 3 Jul 2023 14:28:07 +0800 Subject: [PATCH] houhaoyu@huawei.com add changelog on 4.0.9.1 Signed-off-by: houhaoyu Change-Id: I44e6d7d147e205d99db51f03120b76cb6ba5f8a7 --- .../OpenHarmony_4.0.9.1/changelogs-arkui.md | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/zh-cn/release-notes/changelogs/OpenHarmony_4.0.9.1/changelogs-arkui.md b/zh-cn/release-notes/changelogs/OpenHarmony_4.0.9.1/changelogs-arkui.md index 8db429d81f..6e146e1481 100644 --- a/zh-cn/release-notes/changelogs/OpenHarmony_4.0.9.1/changelogs-arkui.md +++ b/zh-cn/release-notes/changelogs/OpenHarmony_4.0.9.1/changelogs-arkui.md @@ -33,3 +33,86 @@ struct Example { **适配指导** 当事件参数设置为undefined,将会禁用该事件,依据实际应用开发场景进行参数设置即可。 + + +## cl.arkui.2 @Prop/@BuilderParam 状态变量需要初始化或从父组件传值 + +**示例:** + +```ts +// xxx.ets +@Entry +@Component +struct Parent { + @State message: string = 'Parent' + build() { + Column() { + Child() // 编译报错 + } + } +} + +@Component +struct Child { + @Prop message: string + build() { + Column() { + + } + } +} +``` + +**变更影响** + +当@Prop/@BuilderParam 状态变量未初始化且未从父组件传值时,编译无法通过。 + + +**关键的接口/组件变更** + +不涉及。 + +**适配指导** + +对@Prop/@BuilderParam 状态变量做初始化赋值或从父组件调用子组件时传入。 + + +## cl.arkui.3 @BuilderParam 状态变量初始化赋值必须为@Builder函数/方法 + +**示例:** + +```ts +// xxx.ets +@Builder +function builderFunction() { + Text('Hello Builder') +} + +function normal () { + +} + +@Component +struct Index { + @BuilderParam builderParam: ()=>void = builderFunction + @BuilderParam builderParam2: ()=>void = normal // 编译报错 + build() { + Column() { + + } + } +} +``` + +**变更影响** + +@BuilderParam 状态变量初始化赋值非@Builder方法时,编译无法通过。 + + +**关键的接口/组件变更** + +不涉及。 + +**适配指导** + +@BuilderParam 状态变量初始化赋值传入@Builder方法。 -- GitLab