我只是按照本教程中的步骤学习Polymer。
https://www.polymer-project.org/docs/start/tutorial/intro.html
对于那些已经完成此操作的人,有一个名为“post-list.html”的文件。 在这里,有一段代码就像
<post-service id="service" posts="{{posts}}"></post-service>
<div layout vertical center>
<template repeat="{{post in posts}}">
<post-card
favorite="{{post.favorite}}"
on-favorite-tap="{{handleFavorite}}"
hidden?="{{show == 'favorites' && !post.favorite}}">
<img src="{{post.avatar}}" width="70" height="70">
<h2>{{post.username}}</h2>
<p>{{post.text}}</p>
</post-card>
</template>
</div>
正如您所看到的,“帖子”是各张明信片的实际内容。 这是从哪里来的?没有在教程的哪个地方可以找到明信片内容的那些字符串,但肯定会在明信片中填充它们。
答案 0 :(得分:0)
快速浏览一下出现了&#34; post-service&#34;元素实现未涵盖,但它包含在您可以下载的入门项目中。这里的第2段中提到了它 - https://www.polymer-project.org/docs/start/tutorial/step-3.html