后面分享我写的 navmenu  插件
<div id="navmenu" data-wrap="#nav-content" data-child="ul > li" data-trigger="true">
    <ul>
        <li>tab-1</li>
        <li>tab-2</li>
        <li>tab-3</li>
        <li>tab-4</li>
        <li>tab-5</li>
    </ul>
    <div id="nav-content">
        <div>content-1</div>
        <div>content-2</div>
        <div>content-3</div>
        <div>content-4</div>
        <div>content-5</div>
    </div>
    <script>
        require(["jquery","navmenu"],function($,Navmenu){
            var nav = Navmenu($("#navmenu"));
        });
    </script>
</div>