[Dojo] dijit/MenuBar 當PopupMenuBarItem沒有子項Menu時發生parse() error

[Dojo] dijit/MenuBar 當PopupMenuBarItem沒有子項Menu時發生parse() error

 

版本: 1.9

 

完整錯誤訊息 : dojo/parser::parse() error" [object Error]     dojo.js

 

<div data-dojo-type="dijit/MenuBar" id="navMenu">
    <div data-dojo-type="dijit/PopupMenuBarItem">
        <span>OK</span>
        <div data-dojo-type="dijit/DropDownMenu" id="fileMenu">
            <div data-dojo-type="dijit/MenuItem">
                <span>N/A</span>
            </div>
        </div>
    </div>
    <div data-dojo-type="dijit/PopupMenuBarItem">
        <span>ERROR</span>
    </div>
</div>

 

如果沒有子項, 就要用 dijit/MenuBarItem , 不然不只 menu 異常, 連其它 dijit 的套件都會有錯誤出現

    <div data-dojo-type="dijit/MenuBarItem"><!-- 更正版 -->
         <span>ERROR</span> 
    </div>