提交 e795c0a4 编写于 作者: B bojiang

jiangbo91@huawei.com

系统组件和组件名,类名,函数名重名约束
Signed-off-by: Nbojiang <jiangbo91@huawei.com>
Change-Id: I4f316b3ed6ec5efdb57929193717532f236a8a15
上级 6833ac50
......@@ -231,3 +231,27 @@ struct Child {
}
}
```
## 自定义组件名,类名,函数名和系统组件名相同约束。
自定义组件名,类名,函数名不能和系统组件名相同。
示例:
```
// 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.
先完成此消息的编辑!
想要评论请 注册