当我在这个 JSbin 中运行我的代码时,我希望它能够以类似于它在这个演示页面上iron-data-table
的方式呈现填充数据。相反,只有表格标题呈现,但其余单元格无法填充。
可以对 JSbin 进行哪些更改以实现所需的行为?
http://jsbin.com/hepebapori/1/edit?html,控制台,输出<!DOCTYPE html>
<html>
<head>
<base href="https://polygit.org/polymer+:master/components/">
<link rel="import" href="polymer/polymer.html">
<script src="webcomponentsjs/webcomponents-lite.min.js"></script>
<link rel="import" href="iron-ajax/iron-ajax.html">
<link rel="import" href="paper-button/paper-button.html">
<link href="https://rawgit.com/saulis/iron-data-table/master/iron-data-table.html" rel="import">
</head>
<body>
<dom-module id="x-foo">
<template>
<style>
</style>
<paper-button on-tap="msg">Click Me</paper-button>
<iron-ajax auto
url="https://saulis.github.io/iron-data-table/demo/users.json"
last-response="{{users}}"
>
</iron-ajax>
<iron-data-table selection-enabled items="[[users.results]]">
<data-table-column name="Picture" width="50px" flex="0">
<template>
<img src="[[item.user.picture.thumbnail]]">
</template>
</data-table-column>
<data-table-column name="First Name">
<template>[[item.user.name.first]]</template>
</data-table-column>
<data-table-column name="Last Name">
<template>[[item.user.name.last]]</template>
</data-table-column>
<data-table-column name="Email">
<template>[[item.user.email]]</template>
</data-table-column>
</iron-data-table>
</template>
<script>
(function(){
'use strict';
Polymer({
is: 'x-foo',
msg: function() {
console.log('This proves Polymer is working!');
},
});
})();
</script>
</dom-module>
<x-foo></x-foo>
</body>
</html>