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改爲不同即可。