淘汰foreach不适用于数组中的对象
我有一个具有对象列表的数组,我正在尝试循环浏览它,但似乎无法正常工作。
<!-- ko foreach: applicationsAndProducts -->
<p>Apps and Products</p>
<ul>
<li data-bind="text: applicationsAndProducts.Product"></li>
</ul>
<!-- /ko -->
applications and products具有3个值,如
I have an array that has a list of objects and I am trying to loop through it but it seems to not working.
<!-- ko foreach: applicationsAndProducts -->
<p>Apps and Products</p>
<ul>
<li data-bind="text: applicationsAndProducts.Product"></li>
</ul>
<!-- /ko -->
applicationsAndProducts has 3 values as below
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该仅使用
产品
而不是applications and products.product
。检查文档的 foreach bindingYou should only be using
Product
instead ofapplicationsAndProducts.Product
. Check the documentation for foreach binding