和 iOS 类似,要在 tabpanel 中作为一个 Tab 显示的 View 需要提供 tabbar 显示所需的的 title 和 icon 以供正常显示。其中 title 或 icon 两个必须提供一个。否则会提示:Uncaught Error: [ERROR][Ext.Container#onFirstItemAdd] Adding a card to a tab container without specifying any tab configuration
在 View 的 Config 下面配置 title
和 iconCls
两个属性,例如
Ext.define('mu.view.PresidentList', { extend: 'Ext.List', xtype: 'president_list', config: { title: 'presidents', iconCls: 'team', itemTpl: '{firstName} {lastName}', store: "Presidents" } });
原文地址:http://www.tfan.org/faq-configuration-required-to-add-view-to-tab-panel/