我可能做了一些愚蠢的错事。我正在使用Polymer 1.0
并尝试制作一个非常基本的模块。但是当我指定Layout Attributes
时,它们将不起作用。但是,如果我输入class="layout flex [etc..]"
等等,它就会起作用。见下文:
<script src="bower_components/webcomponentsjs/webcomponents.min.js"></script>
<script src="bower_components/time-elements/time-elements.js"></script>
<link rel="import" href="/bower_components/polymer/polymer.html">
<dom-module id="x-chat-list">
<template>
<section class="user-list" layout horizontal>
<div class="avatar {{color}}" style="background-image: url({{avatar}})">
<div class="status {{status}}"></div>
</div>
<div flex>
<div class="username">{{username}}</div>
<div class="text">{{text}}</div>
</div>
<time class="timestamp" is="relative-time" datetime="{{timestamp}}"></time>
</section>
</template>
<script>
Polymer({
is: 'x-chat-list',
properties: {
avatar: '',
color: '',
username: '',
text: '',
status: '',
timestamp: new Date().toISOString()
}
});
</script>
</dom-module>
就好像它不能识别聚合物或其他东西。
谢谢!