1
我剛開始研究我的第一個聚合物網絡應用程序,但我無法弄清楚如何創建一個簡單的聚合物應用程序。我安裝了聚合物和web_components。並使下面的源代碼的index.html文件不知道聚合物爲什麼不起作用
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>My First polymer web APP</title>
<script src="bower_components/webcomponentsjs/webcomponents.min.js"></script>
<link rel="import" href="bower_components/polymer/polymer.html">
</head>
<body>
<polymer-element name="x-foo" noscript>
<template>
<h1>HELLO FROM x-foo</h1>
</template>
</polymer-element>
<x-foo></x-foo>
</body>
</html>
但它似乎並沒有工作。我看着控制檯,這就是我所看到的。我認爲這是沒有問題的:
GET
http://localhost:3000/ [HTTP/1.1 304 Not Modified 23ms]
GET
http://localhost:3000/bower_components/webcomponentsjs/webcomponents.min.js [HTTP/1.1 304 Not Modified 12ms]
GET
XHR
http://localhost:3000/bower_components/polymer/polymer.html [HTTP/1.1 304 Not Modified 3ms]
GET
XHR
http://localhost:3000/bower_components/polymer/polymer-mini.html [HTTP/1.1 304 Not Modified 36ms]
GET
XHR
http://localhost:3000/bower_components/polymer/polymer-micro.html [HTTP/1.1 304 Not Modified 2ms]
mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create
請幫忙,因爲我是初學者聚合物。提前致謝。
爲了以防萬一,您使用的瀏覽器是什麼? – vittore
@vittore Firefox 41.0.2 – user3647254
嘗試關注他們在聚合物峯會上發佈的代碼段http://www.code-labs.io/codelabs/polymer-first-elements/index.html?index=..%2F..% 2Fpolymer-summit&viewga = UA-39334307-12#0告訴我它是否不適合你。 – vittore