0
我嘗試了聚合物的教程,這是工作在聚合物0.5.4罰款,而不是與聚合物0.8聚合物0.8拋出錯誤
的index.html
<!doctype html>
<html>
<head>
<script src="bower_components/webcomponentsjs/webcomponents.js"></script>
<link rel="import" href="post-card.html">
<style>
html,body {
height: 100%;
margin: 0;
background-color: #E5E5E5;
}
</style>
</head>
<body unresolved>
<post-card>
<img width="70" height="70"
src="../images/avatar-07.svg">
<h2>Another Developer</h2>
<p>I'm composing with shadow DOM!</p>
</post-card>
</body>
</html>
和後card.html
工作<link rel="import" href="bower_components/polymer/polymer.html">
<polymer-element name="post-card">
<template>
<style>
:host {
display: block;
position: relative;
background-color: white;
padding: 20px;
width: 100%;
font-size: 1.2rem;
font-weight: 300;
}
.card-header {
margin-bottom: 10px;
}
polyfill-next-selector { content: '.card-header h2'; }
.card-header ::content h2 {
margin: 0;
font-size: 1.8rem;
font-weight: 300;
}
polyfill-next-selector { content: '.card-header img'; }
.card-header ::content img {
width: 70px;
border-radius: 50%;
margin: 10px;
}
</style>
<!-- CARD CONTENTS GO HERE -->
<div class="card-header" layout horizontal center>
<content select="img"></content>
<content select="h2"></content>
</div>
<content></content>
</template>
<script>
Polymer({});
</script>
</polymer-element>
in bower.json如果我從0.8.0改變到0.5.4它的工作原理。任何想法爲什麼這不起作用?