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

!21762 系统组件使用限制changelog

Merge pull request !21762 from Bo Jiang/master
...@@ -77,4 +77,36 @@ struct ListExample { ...@@ -77,4 +77,36 @@ struct ListExample {
.padding({ top: 5 }) .padding({ top: 5 })
} }
} }
``` ```
\ No newline at end of file
## cl.arkui.2 ArkUI系统组件使用场景限制
对ArkUI系统组件的使用场景进行限制,仅允许在struct的build方法内, pageTransition方法内或@Builder修饰的函数内使用。
**示例:**
```
@Entry
@Component
struct Index {
build() {
Row() {
}
}
}
// ERROR:UI component 'Text' cannot be used in this place.
Text('Hello World')
```
**变更影响**
如果ArkUI系统组件不在struct的build方法内,pageTransition方法内,@Builder修饰的函数内使用,编译报错。
**关键的接口/组件变更**
不涉及。
**适配指导**
ArkUI系统组件必须在struct的build方法内,pageTransition方法内,@Builder修饰的函数内使用。
\ No newline at end of file
# arkui子系统ChangeLog
## ArkUI系统组件使用限制
ArkUI系统组件必须在struct的build方法,pageTransition方法,@Builder修饰的函数内使用。
**示例:**
```
@Entry
@Component
struct Index {
build() {
Row() {
}
}
}
// ERROR:UI component 'Text' cannot be used in this place.
Text('Hello World')
```
**变更影响**
如果ArkUI系统组件不在struct的build方法,pageTransition方法,@Builder修饰的函数内使用,编译报错。
**关键的接口/组件变更**
不涉及。
**适配指导**
ArkUI系统组件必须在struct的build方法,pageTransition方法,@Builder修饰的函数内使用。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册