首页 文章

将新页面添加到Polymer Starter Kit

提问于
浏览
0

如何在覆盖整个屏幕的Polymer Starter Kit上添加一个新页面(例如 <my-view4> ),并且 Headers 与默认视图不同?

<app-location route="{{route}}" url-space-regex="^[[rootPath]]">                                               
       </app-location>
       <app-route
        route="{{route}}"
        pattern="[[rootPath]]:page"
        data="{{routeData}}"
        tail="{{subroute}}"></app-route>                             
       <iron-pages
        selected="[[page]]"
        attr-for-selected="name"
        fallback-selection="view404"
        role="main">
      <my-view1 name="view1"></my-view1>
      <my-view2 name="view2"></my-view2>
      <my-view3 name="view3"></my-view3>
      <my-view404 name="view404"></my-view404>
     </iron-pages>

默认的铁页面选择器嵌入到app-header-layout元素中,所有新元素(或视图)都显示在app-header布局中 . 然而,我想添加一个覆盖整个网站的新元素,并在app-header-layout中“打破”铁页沙箱 .

同时,app-route元素仍然可以工作,以便可以通过/ view4链接导航到新路径 . 这可以通过app-route和PSK实现吗?

1 回答

  • 1

    当然有可能,'s why they give that example. I am not sure where exactly is your problem since you did not post any of your own code, this looks like what is provided by the starter kit, but you can try to follow the episode from the Polycasts series that covers the Polymer CLI, and you will see exactly what you'试图做:https://www.youtube.com/watch?v=pj2lmXVa84U

相关问题