Ext.application 在 Ext 5 中未定义

Ext.application is undefined in Ext 5

本文关键字:Ext 未定义 application      更新时间:2023-09-26

我有一个 Ext 应用程序,它在 Ext 4 中运行良好,但在 ext 5 中出现错误。我加载ext-all.js很好。

Ext.application({  // undefined method here
});

我还需要加载什么?

如果您提供更多代码,以便我们可以看到您的错误所在,那将是可取的。但是回答你的问题,你至少需要:

Ext.application({
    name : 'MyApp', // Your app name here
    launch : function() {
        // Your code here 
        Ext.Msg.alert('Test', 'Hello World!');
    }
});

如果此代码不起作用,则可能尚未导入所需的所有文件。