我如何防止lt; span>如果$ root中的某些属性为null,则创建元素?
我在< span>
元素中显示一些文本,
<span data-bind="text: $root.participants()[_propkey].Currency"></span>
当 root.participants()[_ propkey] .currency 是null,我在页面上有一个空白空间。
如果 root.participant()[_ propkey]。
I display some text in a <span>
element which looks like this
<span data-bind="text: $root.participants()[_propkey].Currency"></span>
When root.participants()[_propkey].Currency is null, I get an empty space on page.
How do I prevent this span from getting created if root.participants()[_propkey].Currency is null
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用虚拟元素 和如果绑定以实现您追求的目标
you can use virtual elements and the if binding to achieve what you're after