在polymer 3中使用Google Web组件元素

在polymer 3中使用Google Web组件元素,polymer,google-web-component,polymer-3.x,Polymer,Google Web Component,Polymer 3.x,我们如何在polymer 3中安装Google Web组件元素 示例-使用谷歌youtube或更多元素还不能支持npm安装 是否有人为polymer 3安装此组件。您可以从github中取出组件,并使用polymer 3模块化器将元件转换为polymer 3元件,他们只需将其用于您的应用程序。您可以尝试将其安装为polymer模块化器 npm安装-g聚合物模块化器 您还需要安装bower,然后在回购协议中运行 modulezer谷歌网络组件/google youtube 这将下载组件并将其转换

我们如何在polymer 3中安装Google Web组件元素

示例-使用谷歌youtube或更多元素还不能支持npm安装


是否有人为polymer 3安装此组件。

您可以从github中取出组件,并使用polymer 3模块化器将元件转换为polymer 3元件,他们只需将其用于您的应用程序。

您可以尝试将其安装为polymer模块化器

npm安装-g聚合物模块化器

您还需要安装bower,然后在回购协议中运行

modulezer谷歌网络组件/google youtube

这将下载组件并将其转换到文件夹
moduleizer\u workspace

简单地说:

npm install -g polymer-modulizer
git clone https://github.com/GoogleWebComponents/google-youtube.git
cd google-youtube
modulizer --out .
复制新文件夹“google youtube”并粘贴到节点模块中的项目中


模块化器不适用于我,因此如果只是简单地使用iframe来集成视频。因为我不需要任何google youtube webcomponent属性,这对我的网站来说很好

<iframe 
  class="video-frame"
  src="https://www.youtube.com/embed/[[videoId]]"
  allowfullscreen="allowfullscreen"
  mozallowfullscreen="mozallowfullscreen" 
  msallowfullscreen="msallowfullscreen" 
  oallowfullscreen="oallowfullscreen" 
  webkitallowfullscreen="webkitallowfullscreen"
  frameBorder="0">
</iframe>


有关自动播放等其他查询参数,请参见。

谢谢!我试试这个。我们可以做些什么来转换其他组件,比如-…?在跟踪和导入之后。。导入“@polymer/google-youtube/moduleizer_out/google-youtube.js”;错误:未捕获引用错误:google youtube上未定义Polymer.js:42尝试在js文件中添加这一行,从“@Polymer/Polymer/Polymer legacy.js”;+++导入{Polymer,html}和++。确保Polymer({模板:html`+++++不是++++Polymer({模板:Polymer,html`谢谢!我会试试这个。我们可以做些什么来转换其他组件,比如-…?运行时出错-模块化器GoogleWebComponents/google youtube::未经处理的拒绝在:承诺承诺承诺{错误:--npm版本要求我们怎么做。。?