首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >聚合物1.x:让定制元素在柱塞中说你好世界

聚合物1.x:让定制元素在柱塞中说你好世界
EN

Stack Overflow用户
提问于 2016-10-13 02:58:06
回答 1查看 154关注 0票数 2

元素渲染HELLO?

考虑到更复杂的情况,content-el似乎完全正确地导入了一个iron-data-table。我是不是忽略了一些简单的东西?请用一个工作的响声回答。

http://plnkr.co/edit/p7IE7v6DHLVnEggeO8PF?p=preview

代码语言:javascript
复制
<base href="https://polygit.org/polymer/components/">
<link rel="import" href="polymer/polymer.html">
<script src="webcomponentsjs/webcomponents-lite.min.js"></script>

<dom-module id="x-foo">
    <template>
        <style></style>
        HELLO WORLD
    </template>

  <script>
    (function() {
      'use strict';
      Polymer({
        is: 'x-foo',

            });
        })();
  </script>
</dom-module>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-10-13 04:00:50

您会注意到浏览器控制台显示:

https://polygit.org/polymer/components/polymer/polymer.html未能加载资源:服务器响应状态为400 () https://polygit.org/polymer/components/webcomponentsjs/webcomponents-lite.min.js未能加载资源:服务器响应状态为400 () ReferenceError:聚合物未定义

浏览器无法找到聚合物所需的导入,因为您的<base> URL在x-foo.html中有格式错误的polygit配置。

代码语言:javascript
复制
<base href="https://polygit.org/polymer/components/">

预期URL格式用于polygit.org

代码语言:javascript
复制
<server-name>/[<configurations>/]components/<component>/<path>

其中<configurations>/是:

代码语言:javascript
复制
<component>[+<org>]+<ver>|:<branch>|*

因此,您的<base> URL应该是以下任一内容:

代码语言:javascript
复制
<base href="https://polygit.org/components/">
<base href="https://polygit.org/polymer+:master/components/">
<base href="https://polygit.org/polymer+v1.7.0/components/">

柱塞

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

https://stackoverflow.com/questions/40011560

复制
相关文章

相似问题

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