aurelia/html repeat.for - 冗余元素

aurelia/html repeat.for - redundant elements

我有以下 html(视图):

<li>
    <b>Institute:</b> Length: ${institutes.length}
    <ul>
        <li repeat.for="el of institutes">
        ${el.institute}: ${el.terminalCount}
        </li>
    </ul>
</li>

我在浏览器中看到以下内容:

如上所示,数组 institutes 有 2 个元素,但在列表中我看到另外 4 行 - 具有空值。 它是什么?我该如何解决?

提前致谢。

除了元素之外,您在该数组上肯定还有其他东西。否则就只有两个 LI 标签。

如果你看@ source aurelia 模板中有许多转发器策略。取决于您要迭代的对象的类型。

如果你正在积极开发 aurelia 的东西,我建议你加入 official aurelia discoursegitter channel