How to add content to Polymer SPA example

怎甘沉沦 提交于 2019-12-13 21:30:31

问题


regarding to that article https://www.polymer-project.org/0.5/articles/spa.html i want to know how to add some content?
i know there is an example which loads external html files. but how to add my own content in the other examples?

Thank you

kind regards
Viktoria


回答1:


on the page you linked there is a section headed "then drop in your content:"

then it is followed with this code.

 <div layout horizontal center-center fit>
  <core-animated-pages  selected="0" transitions="slide-from-right">
    <section layout vertical center-center>
      <div>Single</div>
    </section>
    <section layout vertical center-center>
      <div>page</div>
    </section>
    ...
  </core-animated-pages>
</div>

in that code each section tag is a diff page and the content of that page is in the enclosed div tag <div>Single</div> replace that tag to change the app content. it might also help to look over the documentation on the elements used in that example so you have a better understanding of how they work.

animated pages https://www.polymer-project.org/0.5/docs/elements/core-animated-pages.html



来源:https://stackoverflow.com/questions/29914357/how-to-add-content-to-polymer-spa-example

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