Polymer 1.x:帮助让这个 JSBin 呈现 <paper-header-panel> 和 <paper-toolbar>

Polymer 1.x: Help getting this JSBin to render <paper-header-panel> and <paper-toolbar>

http://jsbin.com/mefonoqanu/1/edit?html,output

This JSBin doesn't render its contents。不显示:

What am I doing wrong? Please provide a working JSBin example.

注: Per this link, <paper-header-panel> 要求宿主有 height.

代码

<!DOCTYPE html>
<html>  
<head>
  <meta charset="utf-8">
  <title>Polymer Bin</title>
  <base href="http://element-party.xyz/">
  <script src="bower_components/webcomponentsjs/webcomponents-lite.js"></script>
  <link rel="import" href="all-elements.html">
</head>
<body class="fullbleed layout vertical">
<x-element></x-element>
<dom-module id="x-element">
  <template>
    <style>
    </style>
    <paper-header-panel class="flex">
      <paper-toolbar>Header</paper-toolbar>
      <div>Content goes here...</div>
    </paper-header-panel>   
  </template>
  <script>
    (function(){
      Polymer({
        is: 'x-element'
      });
    })();
  </script>
</dom-module>
</body>
</html>

http://jsbin.com/kabede/5/edit?html,output

变化:

  1. webcomponents 来自 rawgit 而不是 bower_components
  2. <span class="title"> 使 header 可见
  3. style="width:100%; height: 100%;" 在元素上查看其内容
接受答案的代码
<!DOCTYPE html>
<html>  
<head>
  <meta charset="utf-8">
  <title>Polymer Bin</title>
  <script src="https://rawgit.com/webcomponents/webcomponentsjs/master/webcomponents.js"></script>

  <base href="http://element-party.xyz/">
  <link rel="import" href="all-elements.html">

</head>
<body class="fullbleed layout vertical">
<x-element style="width:100%; height: 100%;"></x-element>
  <dom-module id="x-element">
  <template>
    <style>
    </style>
    <paper-header-panel class="flex">
      <paper-toolbar ><span class="title">Header</span></paper-toolbar>
      <div >
        Content goes here...<br>
      </div>
    </paper-header-panel>   
  </template>
  <script>
    (function(){
      Polymer({
        is: 'x-element'
      });
    })();
  </script>
</dom-module>
</html>

Here is the minimum markup necessary to answer the question:

http://jsbin.com/jocinasovo/edit?html,output

变化

  1. 使用 :host
  2. 添加样式
  3. 只需要height不需要width
  4. 无需从 bower_components (per this link) 切换到 rawgit CDN
  5. 不需要 .flex class <paper-header-panel>

注: Per this link, <paper-header-panel> 要求宿主有 height.

代码

<!DOCTYPE html>
<html>  
<head>
  <meta charset="utf-8">
  <title>Polymer Bin</title>
  <base href="http://element-party.xyz/">
  <script src="bower_components/webcomponentsjs/webcomponents-lite.js"></script>
  <link rel="import" href="all-elements.html">
</head>
<body class="fullbleed layout vertical">
<x-element></x-element>
  <dom-module id="x-element">
  <template>
    <style>
      :host {
        height: 100%
      }
    </style>
    <paper-header-panel>
      <paper-toolbar><span>Header</span></paper-toolbar>
      <div>Content goes here...</div>
    </paper-header-panel>   
  </template>
  <script>
    (function(){
      Polymer({
        is: 'x-element'
      });
    })();
  </script>
</dom-module>
</body>
</html>