egret-labs / egret-examples

egret-examples

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error ...EUIExample/src/Main.ts (39,36): Cannot find name 'components'.

huyong007 opened this issue · comments

bash-3.2$ egret build EUIExample -e
您正在使用白鹭编译器 5.2.29 版本
扫描项目列表
Error /Users/yonghu/all/luochen/work/egret-examples/EUIExample/src/Main.ts (39,36): Cannot find name 'components'.

请问如上问题是如何造成的,如何解决呢?

看rc/2.5分支,master分支丢失了一个MainGroup.d.ts文件
直接把src/Main.ts:39

var group: eui.Group = new components.MainGroup();

改为

var group: eui.Group = new eui.Group();
commented

请在 Main.ts 最上面 加上如下代码声明
declare module components { export class MainGroup extends eui.Group { } }