简体   繁体   English

Polymer 2.0 Firebase查询无法与dom-repeat模板一起使用

[英]Polymer 2.0 firebase-query not working with a dom-repeat template

I have problems with this dom-repeat template: 我有这个dom-repeat模板的问题:

<firebase-query
 id="query"
 app-name="guiameDB"
 path="/MerloSL/farms"
 data="{{data}}">
</firebase-query>

  <template is="dom-repeat" items="[[data]]">
    <p>[[data.$key.nomb]]</p>
  </template>

The firebase node in farms is just like this object that I threw to console: 场中的firebase节点就像我扔给控制台的这个对象一样:

(7) [{…}, {…}, {…}, {…}, {…}, {…}, {…}]
$key : "0"
coment : "A metros de esquina con Comechingones"
dire : "Los Huarpes 88"
nomb : "Los Huarpes"
tel: "+5402656 475462"
turno: "Lunes"
__proto__ : Object 
1 : $key:"1"
coment : "Fr..."
etc...

If I put a 0 or a 1,2 etc. instead of the $key variable, it works, but with only one item, of course. 如果我将0或1,2等代替$ key变量,它将起作用,但是只有一个项目。 Any idea on this? 有什么想法吗? Thanks in advance 提前致谢

You don't need to put $key . 您不需要放$key Change your dom-repeat code to: 将您的dom-repeat代码更改为:

<template is="dom-repeat" items="[[data]]">
    <p>[[data.nomb]]</p>
</template>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM