iron-data-table未加载数据

时间:2018-03-19 13:50:55

标签: polymer

<iron-ajax
    auto
    url="http://127.0.0.1:8081/src/users.json"
    handle-as="json"
    last-response="{{users}}"
    debounce-duration="300"></iron-ajax>

      <iron-data-table items="[[users]]">

        <data-table-column name="First Name">
          <template>[[item.name.title]]</template>
        </data-table-column>
        <data-table-column name="Last Name">
          <template>[[item.name.last]]</template>
        </data-table-column>
        <data-table-column name="Email">
          <template>[[item.name.first]]</template>
        </data-table-column>
      </iron-data-table>

我的JSON:

[
  {"name": {
    "title": "miss",
    "first": "donna",
    "last": "davis"
  }},
  {"name": {
    "title": "mr",
    "first": "samuel",
    "last": "kelley"
  }},
  {"name": {
    "title": "ms",
    "first": "katie",
    "last": "butler"
  }}
]

这会出现以下错误:

  

“未捕获的TypeError:无法读取未定义的属性'列'”   “iron-data-table.html:849 Uncaught TypeError:dataSource不是函数”

0 个答案:

没有答案