1

嘿,我的 enyo 应用程序中的菜单有问题。基本上, maxHeight 没有做任何事情。我削减了我的代码以强调这个问题:

enyo.kind({
name: "App",
fit: true,
components:[
    {kind: "onyx.MenuDecorator", components: [
        {name: "firstMonthContent", content: "Month"},
        {name: "firstMonth", kind: "onyx.Menu", maxHeight: 200, onSelect: "getFirstMonth", components: [
                {value: "0", content: "Jan", classes: "menuItem"},
                {value: "1", content: "Feb", classes: "menuItem"},
                {value: "2", content: "Mar", classes: "menuItem"},
                {value: "3", content: "Apr", classes: "menuItem"},
                {value: "4", content: "May", classes: "menuItem"},
                {value: "5", content: "Jun", classes: "menuItem"},
                {value: "6", content: "Jul", classes: "menuItem"},
                {value: "7", content: "Aug", classes: "menuItem"},
                {value: "8", content: "Sep", classes: "menuItem"},
                {value: "9", content: "Oct", classes: "menuItem"},
                {value: "10", content: "Nov", classes: "menuItem"},
                {value: "11", content: "Dec", classes: "menuItem"},
        ]}
    ]},
],
});

只是一个基本菜单,除 maxHeight 外,一切正常。问题是,当我将它放入 jsfiddle 时,它​​完全可以正常工作(http://jsfiddle.net/sqHSL/17/)。我创建了一个新的 enyo 文件,其中只有这个,它仍然会导致这个问题,所以我不知道该怎么做才能修复它。有人有什么建议吗?

4

1 回答 1

0

无法弄清楚实际原因,但我确实找到了解决方法。

                {kind: "onyx.MenuDecorator", maxHeight: "5px", components: [
                    {name: "firstMonthContent", content: "Month"},
                    {name: "firstMonth", kind: "onyx.Menu", onSelect: "getFirstMonth", components: [
                        {name: "menuScroller2", kind: "enyo.Scroller", defaultKind: "onyx.MenuItem", vertical: "auto", classes: "enyo-unselectable", maxHeight: "200px", components: [
                            {value: "0", content: "Jan", classes: "menuItem"},
                            {value: "1", content: "Feb", classes: "menuItem"},
                            {value: "2", content: "Mar", classes: "menuItem"},
                            {value: "3", content: "Apr", classes: "menuItem"},
                            {value: "4", content: "May", classes: "menuItem"},
                            {value: "5", content: "Jun", classes: "menuItem"},
                            {value: "6", content: "Jul", classes: "menuItem"},
                            {value: "7", content: "Aug", classes: "menuItem"},
                            {value: "8", content: "Sep", classes: "menuItem"},
                            {value: "9", content: "Oct", classes: "menuItem"},
                            {value: "10", content: "Nov", classes: "menuItem"},
                            {value: "11", content: "Dec", classes: "menuItem"},
                        ]}
                    ]}
                ]},
于 2013-01-14T03:52:29.983 回答