Cannot read property 'READURL' of undefined

Cannot read property ‘READURL’ of undefined引发的问题

最近在在做一个手机app,使用sencha touch,不小心某个页面的xtype与另外一个页面的xtype相同,使用sencha web start启动,在浏览器打开可以正常运行,但是使用sencha app build package压缩以后在浏览器上运行,就会一直报错:Cannot read property ‘READURL’ of undefined。

搞了很久才发现时两个页面的id冲突了,特此记录一下,希望下次注意不要犯这种错误。

Ext.define("apes.view.VideoContainer", {
    extend: "Ext.Container",
    xtype: "VideoContainer",////此处冲突引起错误
    //代码省略...
    })
Ext.define("apes.view.video.VideoContainer", {
    extend: "Ext.Container",
    xtype: "VideoContainer",//此处冲突引起错误
    //代码省略...
    })
    就是因为xtype相同引起错误,将xtype改为不同即可。
    
    

猜你喜欢

转载自blog.csdn.net/Scryhuaihuai/article/details/79661182