Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法在 onsen ui 的不同 html 页面中包含常用元素,例如拆分菜单,而不是在每个页面上重复代码?
您的问题有点含糊,但如果我理解正确,您希望 ons-splitter 在多个页面上持续存在?如果是这种情况,您应该只更新 ons-splitter 中的 ons-splitter-content,它可以是任何有效的 html。
同样的事情也适用于 ons-tabbar 例如,更改“内容”元素,标签结构将跨页面保持不变。
这是文档中带有拆分器的多个页面的示例:
https://onsen.io/v2/api/js/ons-splitter.html