2017-08-18 62 views
1

我有這個DOM重複模板問題工作聚合物2.0火力查詢不與DOM的重複模板

(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... 

如果我把一個0或一個1,2等等,而不是$ key變量,它的工作原理,但只有一個項目,當然。 對此有何想法?在此先感謝

回答

0

你不需要把$key。 更改dom-repeat代碼:

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

感謝Ofisora,我已經嘗試過這種方式,它did'n工作。看起來'data.nomb'不存在,而是'data。「存在一些id」.nomb「,我不知道如何在這個層次上鑽取。 – Adr