Polymer 尝试通过bower安装聚合物套筒

Polymer 尝试通过bower安装聚合物套筒,polymer,bower,polyfills,quill,Polymer,Bower,Polyfills,Quill,bower和web组件的新功能。我正在试着用鲍尔来安装 npm install -g bower mkdir polymerquill cd polymerquill bower install --save polymer-quill 现在我有一个完整的bower_组件目录。我创建一个index.html文件并添加以下内容: <!DOCTYPE html> <html> <head> <title></title>

bower和web组件的新功能。我正在试着用鲍尔来安装

npm install -g bower
mkdir polymerquill
cd polymerquill
bower install --save polymer-quill
现在我有一个完整的bower_组件目录。我创建一个index.html文件并添加以下内容:

<!DOCTYPE html>
<html>
<head>
    <title></title>
    <script src="bower_components/webcomponentsjs/webcomponents-lite.min.js"></script>
    <link rel="import" href="bower_components/polymer-quill/polymer-quill.html">
</head>
<body>
    <h1>PolyQuill</h1>
    <style is="custom-style">
      polymer-quill.full {
        --polymer-quill-editor-max-height: 300px;
        --polymer-quill-editor-min-height: 100px;
      }
    </style>
    <h2>Full Toolbar, Show Results, Max Height (300px), Min Height (100px), Save as Deltas, Save every 1 second</h2>
    <polymer-quill content='{"ops":[{"insert":"Hello World! - Store as Delta"},{"attributes":{"header":2},"insert":"\n"}]}'
      class='full'
      store-as="delta"
      save-interval="1000"
      toolbar-type="full"
      show-results>
    </polymer-quill>
    <h2>Standard Toolbar, Hide Results, Default height (100px), Save as HTML, Save every 2 seconds</h2>
    <polymer-quill content="<h2>Hello World! - Store as HTML</h2>" store-as="html"></polymer-quill>
</body>
</html>

然而,当我用Chrome打开它时,我只看到h2。聚合物纬管元素不渲染。我忘记做什么了?

我相信这个元素目前只在聚合物的阴暗DOM中起作用

如果您使用的是Polymer 1.0,请通过在index.html中添加以下脚本来声明shady DOM:


我在Elm做了这件事,这段视频帮助很大:
<script>
  /* this script must run before Polymer is imported */
  window.Polymer = {
    dom: 'shadow',
    lazyRegister: true
  };
</script>
<script src="webcomponentsjs/webcomponents-loader.js" shadydom></script>