2014-10-30 37 views

回答

8

從聚合物工程現場是或我猜您的CloudFlare CDN如果你知道位置

<script src="http://www.polymer-project.org/platform.js"></script> 
<link rel="import" href="http://www.polymer-project.org/components/polymer/polymer.html"> 
<link rel="import" href="http://www.polymer-project.org/components/paper-button/paper-button.html"> 
<link rel="import" href="http://www.polymer-project.org/components/core-header-panel/core-header-panel.html"> 

這僅僅是用於開發和生產沒有。

如果你轉到polymer elements然後選擇你的元素,然後點擊Get Element按鈕,它會給你一個帶有導入鏈接的彈出框。

您也可以從here

+0

看來這些自1.0不再起作用。他們給'404'。但是你可以從[polymer-cdn](https://github.com/download/polymer-cdn)抓取它們。 – 2015-07-17 20:54:51

+0

啊我想通了。對於舊版本,這些仍然可以使用,但是你必須在網址中加上'0.5':http://www.polymer-project.org/0.5/components/polymer/polymer.html – 2015-07-17 21:00:27

+0

我認爲這是非常可怕的儘管(除了'0.5'),URL中沒有任何版本。我個人認爲你應該總是使用URL到一個特定的版本,而不是一些可以在任何時候改變的'主'... – 2015-07-17 21:02:34

4

得到一個鏈接的所有核心或紙張元素一個不錯的選擇 - 仍在進展中的工作 - 爲https://ele.io/

俄勒(稱之爲「艾莉」)是一個精簡的環境用於探索,試驗和共享使用Web組件製作的可重複使用的自定義HTML元素。

+0

看起來真的很過時。 GitHub repo最近於2014年12月更新,似乎不支持Polymer 1.0。 https://github.com/divshot/ele-web – Ajedi32 2015-06-16 14:33:00

+2

Ele的創造者之一 - 很想爲Polymer 1.0更新它,只是沒有時間。 – 2015-06-17 16:50:31

0

爲了測試寫在聚合物1.0我用這個片段的簡單組件:

<link rel="import" href="https://raw.githubusercontent.com/Polymer/polymer/master/polymer.html"> 

<dom-module id="proto-element"> 
    <template> 
     <span>I'm <b>proto-element</b>. Check out my prototype.</span> 
    </template> 
</dom-module> 

<script> 
    Polymer({ 
     is: "proto-element", 
     ready: function() { 
      //... 
     } 
    }); 
</script> 

<proto-element></proto-element> 

http://jsfiddle.net/MartyIX/84b5sabw/