我正在努力iron-list
与iron-flex-layout
and相处融洽paper-card
。我希望的是paper-card
在两个轴上弯曲扩展以覆盖页面(其边距作为保险杠),然后iron-list
在其容器中垂直扩展以显示我的铁列表及其所有“虚拟列表”魔法.
我哪里错了?
<script src="https://cdn.rawgit.com/Download/polymer-cdn/24b44b55/lib/webcomponentsjs/webcomponents-lite.min.js"></script>
<link rel="import" href="https://cdn.rawgit.com/Download/polymer-cdn/24b44b55/lib/paper-card/paper-card.html">
<link rel="import" href="https://cdn.rawgit.com/Download/polymer-cdn/24b44b55/lib/paper-progress/paper-progress.html">
<link rel="import" href="https://cdn.rawgit.com/Download/polymer-cdn/24b44b55/lib/iron-flex-layout/iron-flex-layout-classes.html">
<link rel="import" href="https://cdn.rawgit.com/Download/polymer-cdn/24b44b55/lib/iron-list/iron-list.html">
<style is="custom-style" include="iron-flex iron-flex-alignment iron-positioning">
body {
margin: 0;
height: 100vh;
}
paper-card {
margin: 1em;
}
iron-list {
border-bottom: 1px solid #f00;
border-top: 1px solid #000;
}
</style>
<div class="vertical layout">
<template is="dom-bind" id="app">
<paper-card heading="My paper card" class="flex">
<div class="card-content layout vertical">
<div>[[listing.length]]</div>
<iron-list items="[[listing]]" class="flex">
<template>
<div class="layout horizontal">
<div>[[item.name]]</div>
<div>[[item.value]]</div>
</div>
</template>a
</iron-list>
</div>
</paper-card>
</template>
</div>
<script>
"use strict";
window.addEventListener('WebComponentsReady', e => {
app.listing = [];
for (var i = 0; i < 100; i++) {
app.push('listing', { name: i, value: i });
}
});
</script>