我有这个代码:
Ext.define('Operations.view.main.menu.MainMenuModel', {
extend: 'Ext.app.ViewModel',
alias: 'viewmodel.mainmenu',
requires: [
'Ext.data.TreeStore',
'Operations.data.schema.TreeSchema',
'Operations.model.MainMenu'
],
schema: 'tree',
stores: {
mainMenuStore: {
type: 'tree',
model: 'MainMenu',
root: {
expanded: true,
children: [{
text: 'Operations',
iconCls: 'x-fa fa-home',
leaf: true
}]
}
}
}
});
它不起作用。
如果我将model: 'MainMenu',
改为model: 'Operations.model.MainMenu',
,那就行了!神秘!为什么会这样?他为什么要求你指定全名?这是我遇到的唯一地方。
我用Sencha ExtJS 6.0.2 Classic
模型不支持别名,因此您需要指定全名。
别名以namespace.name格式编写。 支持的命名空间(文档对此非常模糊,因此可能会有更多):