提交 3ba4bc78 编写于 作者: E ester.zhou

Update doc (16570)

Signed-off-by: Nester.zhou <ester.zhou@huawei.com>
上级 e7ea18b3
...@@ -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.
先完成此消息的编辑!
想要评论请 注册