Quintout.js更改图像源点击点击
我在代码中有此部分,
<script id="performance-objective-template" type="text/template">
<ul class="node">
<li class="item-container" data-bind="css: { 'expanded': $data.IsExpanded, 'has-children': $data.Children().length > 0, 'new': $data.Id() == 0 }">
<span class="arrow"></span>
<a class="item" data-bind="click: $root.toggleExpanded, css: $root.itemClass($data)">
<span class="name" data-bind="text: Description"></span>
<span class="kpi">
<img width="20" height="20" data-bind="attr: { src: $root.selectionIcon($data) }" />
</span>
</a>
<div class="actions">
</div>
</li>
</ul>
</script>
我有两个映像图标供批准和拒绝,并希望每次点击之间翻转它们,并在模型对象上设置属性。 到目前为止,我正在努力修改IMG部分。如果我实现了之类的单击:$ root.changeicon
,则该功能永远不会被执行。
我应该如何实现这种行为?
任何帮助都非常感谢。
I am having this section in my code
<script id="performance-objective-template" type="text/template">
<ul class="node">
<li class="item-container" data-bind="css: { 'expanded': $data.IsExpanded, 'has-children': $data.Children().length > 0, 'new': $data.Id() == 0 }">
<span class="arrow"></span>
<a class="item" data-bind="click: $root.toggleExpanded, css: $root.itemClass($data)">
<span class="name" data-bind="text: Description"></span>
<span class="kpi">
<img width="20" height="20" data-bind="attr: { src: $root.selectionIcon($data) }" />
</span>
</a>
<div class="actions">
</div>
</li>
</ul>
</script>
I have two image icon for Approved and Rejected and would like to flip between them each click and also set the property on the Model object.
So far I am struggling to modify the img section. If I implement something like click: $root.changeIcon
, the function never get executed.
How should I achieve this behavior ?
Any help is much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论