【发布时间】:2015-06-06 16:49:26
【问题描述】:
我正在关注 https://www.youtube.com/watch?v=wId1gMzriRE 的 Polymer 教程
我使用的是 Polymer 1.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>
但是我在浏览器中得到的只是如下;没有“你好世界!”被渲染。
我错过了什么吗?我怎样才能找出问题出在哪里?
下面附上我的目录结构。
【问题讨论】:
标签: polymer web-component