How to add content to Polymer SPA example

2019-09-06 01:30发布

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条回答
Anthone
2楼-- · 2019-09-06 02:28

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

查看更多
登录 后发表回答