【发布时间】:2014-07-23 15:43:13
【问题描述】:
在 for each 绑定中,我将如何尝试切换单个 p 而不是 for each 绑定中的所有 P 元素,希望这不会太令人困惑:)
<div data-bind="foreach: items">
<p data-bind="click:somefunction" class="p1"> </P>
<p class="p2"> </p>
</div>
var shellModel = {
observables .....,
somefunction: function() {
....here i need to toggle p2 (display on/off) not all though, only the one click on or rather the p below
}
}
【问题讨论】: