In this Plunk, why won't the x-foo
element render HELLO WORLD?
鉴于更复杂content-el
似乎正确地导入iron-data-table
。我忽略了简单的事情吗?请回答一下工作插件。
<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>
答案 0 :(得分:2)
您会注意到浏览器控制台显示:
https://polygit.org/polymer/components/polymer/polymer.html无法加载资源:服务器响应状态为400()
https://polygit.org/polymer/components/webcomponentsjs/webcomponents-lite.min.js无法加载资源:服务器响应状态为400()
x-foo.html:14未捕获的ReferenceError:未定义聚合物
浏览器无法找到Polymer所需的导入,因为您的<base>
网址x-foo.html
中格式错误的多字形配置:
<base href="https://polygit.org/polymer/components/">
polygit.org
预计URL format:
<server-name>/[<configurations>/]components/<component>/<path>
其中<configurations>/
是:
<component>[+<org>]+<ver>|:<branch>|*
因此,您的<base>
网址应为以下任意一种:
<base href="https://polygit.org/components/">
<base href="https://polygit.org/polymer+:master/components/">
<base href="https://polygit.org/polymer+v1.7.0/components/">