How to implement two slide-menu on both sides of a page in Onsen-UI?

落爺英雄遲暮 提交于 2019-12-10 17:48:44

问题


I'm new to Onsen-UI and would like to have slide-menus on both sides of my page. I intend to have multiple pages that will have this functionality and dont know how I can implement that. What is the best way to do that?


回答1:


You have to nest two different ons-sliding-menu like this:

<ons-sliding-menu
        main-page="page"
        menu-page="menu-left.html"
        side="left" ...>
</ons-sliding-menu>

<ons-template id="page">
    <ons-sliding-menu
            main-page="content.html"
            menu-page="menu-right.html"
            side="right" ...>
    </ons-sliding-menu>
</ons-template>

<ons-template id="menu-left.html"> ... </ons-template>
<ons-template id="menu-right.html"> ... </ons-template>
<ons-template id="content.html"> ... </ons-template>

Working here: http://codepen.io/onsen/pen/qHeJx

Hope it helps :)



来源:https://stackoverflow.com/questions/30163377/how-to-implement-two-slide-menu-on-both-sides-of-a-page-in-onsen-ui

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!