我正在学习https://www.youtube.com/watch?v=wId1gMzriRE的聚合物教程
我正在使用Polymer1.0(教程是一个较旧的版本)。我把platform.js改成了webcomponents.js。
现在我的index.html是
<!doctype html>
<html>
<head>
<title>Polymer Trial</title>
<script src="bower_components/webcomponentsjs/webcomponents.js"></script>
<link rel="import" href="elements/hello-world.html">
</head>
<body>
<h2>Test</h2>
<hello-world></hello-world>
</body>
</html>我的元素文件hello-world.html作为
<link rel="import" href="../bower_components/polymer/polymer.html">
<polymer-element name="hello-world" noscript>
<template>
<h1>Hello World!</h1>
</template>
</polymer-element>但我在浏览器中得到的只是如下所示,没有“你好世界!”被渲染。

我是不是遗漏了什么?我怎么知道问题出在哪里?
下面是我的目录结构。

发布于 2015-06-06 17:06:49
较早的教程将不适用于聚合物1.0,因为有许多剧烈的变化。在新版本中,Hello看起来如下:
<dom-module id="hello-world">
<template>
<h1>Hello world!</h1>
</template>
</dom-module>
<script>
Polymer({
is: 'hello-world'
});
</script>更多信息可以在https://www.polymer-project.org/1.0/docs/devguide/feature-overview.html的聚合物文档中找到。
https://stackoverflow.com/questions/30685267
复制相似问题