简体   繁体   中英

How to include common elements in onsen ui pages?

有没有一种方法可以在普通用户界面的不同html页面中包含commmon元素,例如splitter菜单,而不是在每个页面上重复代码?

Your question was kinda vague, but if I understand correctly you want the ons-splitter to persist across multiple pages? If that's the case, you should just be updating the ons-splitter-content inside ons-splitter, it can be any valid html.

Same thing goes for ons-tabbar for example, change the "content" element, and the tab structure will persist across pages.

Here's an example in the documentation for multiple pages with a splitter:

https://onsen.io/v2/api/js/ons-splitter.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM