Meteor App 中的聚合物元素 [英] Polymer Elements in a Meteor App

查看:32
本文介绍了Meteor App 中的聚合物元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人成功地将 Polymer 元素添加到 Meteor 项目中?我正在努力让它发挥作用.

Has anyone successfully added Polymer elements to a Meteor project? I'm struggling to make it work.

我已经尝试使用 bower 在 public 下安装 Polymer 包:

I've tried using bower to install the Polymer package under public:

├── public
│   ├── bower_components
│   │   ├── platform
│   │   └── polymer
│   ├── elements
│   │   └── my-element.html

然后我包含这样的元素:

I then included the element like this:

<head>
  <title>test</title>
  <script src="bower_components/platform/platform.js"></script>
  <link rel="import" href="elements/my-element.html">
</head>
<body>
  ...
  <my-element></my-element>
  ...
</body>

这导致了对 platform.js 和 my-element.html 的 XHR 请求的无限循环.

That's resulting in an endless loop of XHR requests for platform.js and my-element.html.

我也试过 meteor-polymer 包,它不包含polymer.html,我做不到'无论如何都要让它识别包裹:

I've also tried the meteor-polymer package, that doesn't include polymer.html and I couldn't get it to recognize the package anyway:

=> Errors prevented startup:

While building the application:
error: no such package: 'polymer'

我希望有人能够让 Polymer 与 Meteor 一起工作,因为我真的很想在这个应用程序中使用我的组件.

I'm hoping someone has been able to get Polymer working with Meteor as I'd really like to use my components in this app.

推荐答案

我创建了一个包来向 Meteor 添加 Polymer 功能.

I have created a package to add Polymer functionality to Meteor.

这里是github.

http://github.com/ecwyne/meteor-polymer

更新:也可以使用 meteor add ecwyne:polymer-elements

这篇关于Meteor App 中的聚合物元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆