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

!16570 系统组件和组件名,类名,函数名重名约束

Merge pull request !16570 from Bo Jiang/master
......@@ -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.
先完成此消息的编辑!
想要评论请 注册