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

!16959 翻译完成 16570:系统组件和组件名,类名,函数名重名约束

Merge pull request !16959 from ester.zhou/TR-16570
...@@ -232,3 +232,26 @@ struct Child { ...@@ -232,3 +232,26 @@ struct Child {
} }
} }
``` ```
## Restrictions on Naming Custom Components, Classes, and Functions
The name of a custom component, class, or function cannot be the same as any system component name.
Example:
```
// Rect.ets
export class Rect {
constructor(){}
}
// Index.ets
// ERROR: The module name 'Rect' can not be the same as the inner component name.
import { Rect } from './Rect';
@Entry
@Component
struct Index {
build() {
}
}
```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册