我已經創建了一個Polymer元素,如下所示。聚合物在http服務器上不顯示任何東西
你好-world.html
<link rel="import" href="../bower_components/polymer/polymer.html">
<dom-module id="hello-world">
<template>
<p><h1>Hello World</h1></p>
</template>
<script>
Polymer ({ is: "hello-world", });
</script>
</dom-module>
加載它是如下的HTML文件: 的index.html
<!DOCTYPE html>
<html>
<head>
<script src="bower_components/webcomponentsjs/webcomponents.js"></script>
<link rel="import" href="elements/hello-world.html">
</head>
<body>
<hello-world></hello-world>
</body>
</html>
在命令提示,我存在的文件夾中(C: \用戶\管理\聚合物)包含index.html和我已經安裝在該文件夾中的http服務器,並已啓動服務器與
http-server C:\Users\Admin\polymer
啓動localhost:8080/index.html將顯示一個空白網頁。需要解決的問題在哪裏?
感謝您的回答。然而,我提到聚合物元素是用'hello-world.html'寫成的。和'index.html'正在訪問它。 –