Polymer core scaffold中每个页面的不同工具栏
我目前正在使用core scaffold作为我的基本应用程序结构。但是,我希望每个页面都有一个不同的工具栏。我想做类似的事情:Polymer core scaffold中每个页面的不同工具栏,polymer,paper-elements,core-elements,Polymer,Paper Elements,Core Elements,我目前正在使用core scaffold作为我的基本应用程序结构。但是,我希望每个页面都有一个不同的工具栏。我想做类似的事情: <core-scaffold> <core-header-panel navigation flex mode="seamed"> <core-toolbar> Veganolux </core-toolbar>
<core-scaffold>
<core-header-panel navigation flex mode="seamed">
<core-toolbar>
Veganolux
</core-toolbar>
<core-menu>
<paper-item icon="store" label="Restaurants" on-tap="{{showRestaurants}}"></paper-item>
<paper-item icon="settings" label="Settings" on-tap="{{showSettings}}"></paper-item>
<paper-item icon="info" label="About" on-click="{{showAbout}}"></paper-item>
</core-menu>
</core-header-panel>
<div tool>Restaurants</div>
<core-pages id="pages" selected="0">
<section id="pageRestaurants">
<div tool>Toolbar with buttons</div>
</section>
<section id="pageSettings">
<div tool>Toolbar without buttons</div>
</section>
<section id="pageAbout">
<div tool>Toolbar with other buttons</div>
</section>
</core-pages>
</core-scaffold>
素食主义者
餐厅
带按钮的工具栏
没有按钮的工具栏
带有其他按钮的工具栏
然而,这是不可能的,因为不是核心支架的直接子代。我知道我可以添加数据绑定来更改标题,但是如果我在工具栏上添加不同的按钮等,会变得很复杂。一个选项是创建一个
activePage
变量来保存当前选择的页面。点击on-tap
事件处理程序将更新activePage
变量。然后,您可以将核心标题面板的部分包装在条件模板中,如
另一个选项是创建多个布局元素,并在这样的布局中包装页面元素