我正在用家庭标签写一个简单的应用程序,其中应该有3个标签,叫做“早餐”、“午餐”和“晚餐”。然而,标签在家里不起作用。它们显示,但对点击没有反应。
代码:
view/Main.js
Ext.define('MyApp.view.Main', {
extend: 'Ext.tab.Panel',
requires: ['Ext.TitleBar'],
xtype: 'main',
config: {
    tabBarPosition: 'bottom',
    items: [
        {
            xtype: 'menu',
        }
    ]
}});
视图/Menu.js
Ext.define('MyApp.view.Menu', {
extend: 'Ext.tab.Panel',
requires: ['Ext.TitleBar'],
xtype: 'menu',
config: {
    title: 'Menu',
    iconCls: 'home',
    tabBar: {
        layout: {
            pack: 'center'
        }
    },
    items: [
        {
            title: 'Breakfast',
            items: {
                docked: 'top',
                xtype: 'titlebar',
                title: 'Breakfast Menu'
            },
            html: [
                "Breakfast menu will be here"
            ].join("")
        },
        {
            title: 'Lunch',
            items: {
                docked: 'top',
                xtype: 'titlebar',
                title: 'Lunch Menu'
            }
            html: [
                "Lunch menu will be here"
            ].join("")
        },
        {
            title: 'Dinner',
            items: {
                docked: 'top',
                xtype: 'titlebar',
                title: 'Dinner Menu'
            },
            html: [
                "Dinner menu will be here"
            ].join("")
        },
    ]
}})
发布于 2014-02-18 18:10:04
问题解决了..。显然,命名为xtype:‘菜单’导致了问题。不要用通用名称命名xtype!
https://stackoverflow.com/questions/21861682
复制相似问题