首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >流星和聚合物运行得很慢

流星和聚合物运行得很慢
EN

Stack Overflow用户
提问于 2014-11-07 09:53:54
回答 1查看 548关注 0票数 1

我想使用聚合物在一个流星应用程序的用户界面。因此,我添加了以下软件包:

代码语言:javascript
复制
ecwyne:polymer           1.0.2  Add Polymer Base to meteor Project

ecwyne:polymer-elements  1.0.3  Add Polymer-Elements to Meteor

加载核心元素一开始似乎是完美无缺的。但是,当代码变得更复杂时,它开始运行得非常慢,我在FF33中得到了这个错误:

代码语言:javascript
复制
 mutating the [[Prototype]] of an object will cause your code to run  very slowly; instead create the object with the correct initial  [[Prototype]] value using Object.create

Chrome也在放缓。我的代码是:

代码语言:javascript
复制
<head>
    <title>mali</title>

        <link rel="import" href="bower_components/core-header-panel/core-header-panel.html">
        <link rel="import" href="bower_components/core-toolbar/core-toolbar.html">
        <link rel="import" href="bower_components/core-icon-button/core-icon-button.html">
        <link rel="import" href="bower_components/core-card/core-card.html">
</head>

<body>
    <style>    
      #design_host {
        position: absolute;
        width: 100%;
        height: 100%;
        box-sizing: border-box;
      }
      #core_header_panel {
        width: 100%;
        height: 100%;
        left: 0px;
        top: 0px;
        position: absolute;
      }
      #core_toolbar {
        background-color: rgb(79, 125, 201);
        color: rgb(255, 255, 255);
      }
      #section {
        height: 1000px;
        background: linear-gradient(rgb(214, 227, 231), lightblue) repeat scroll 0% 0% transparent;
      }
      #core_card {
        position: absolute;
        width: 300px;
        height: 300px;
        background-color: rgb(255, 255, 255);
        border-radius: 2px;
        box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.098), 0px 0px 3px rgba(0, 0, 0, 0.098);
        left: 330px;
        top: 186px;
      }

    </style>
    <core-header-panel mode="standard" id="core_header_panel">
      <core-toolbar id="core_toolbar">
        <core-icon-button icon="menu" id="core_icon_button"></core-icon-button>
        <div id="div">MALI</div>
      </core-toolbar>
      <section id="section">
          <core-card id="core_card">

           </core-card>

      </section>
    </core-header-panel>
</body>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-02-02 06:08:24

这可能是由于HTTP请求过多造成的。differential.io的工作人员创建了一个包装硫化npm包的包,该包用于将web组件处理成单个输出文件。

您可以添加一个包: differential:vulcanize

代码语言:javascript
复制
meteor add differential:vulcanize

更多信息请访问:https://atmospherejs.com/differential/vulcanizehttp://differential.com/blog/meteor-polymer

希望能帮上忙

干杯!

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/26798497

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档