【发布时间】:2016-08-23 07:17:16
【问题描述】:
我是 Aurelia 的新手,在值绑定中遇到这个问题,我不明白为什么它不起作用。
所以我有一个父组件,这是它使用子组件的 html 的一部分:
<div repeat.for="testWebsite of testWebsites" class="tab-pane ${$index==0? 'active' : ''}" id="${testWebsite.website_id}" role="tabpanel">
<test-website showSummaryBar.bind="testWebsites.length > 1" payload.bind="testWebsite"></test-website>
</div>
test-website 是子组件。在其代码中,我声明了 2 个可绑定变量,如下所示:
export class TestWebsiteCustomElement {
@bindable payload;
@bindable showSummaryBar;
.....
payload 已成功绑定到父级设置的 testWebsite。但是 showSummaryBar 始终为空。我错过了什么吗?提前致谢。
【问题讨论】:
标签: aurelia