gpt4 book ai didi

angularjs - angular-ui-tree 中可拖动节点中的可点击链接

转载 作者:行者123 更新时间:2023-12-04 05:40:04 25 4
gpt4 key购买 nike

angular-ui-tree我正在寻找一种在可拖动节点内有链接的方法。

现在发生的事情是,当我单击节点内的链接时,它开始“按住”整个节点来拖动它。

我看到了这个答案Angular JS (angular-ui-tree) ng-click conflict vs drag start event ,但是它与我想要做的不同。在这个答案ng-click绑定(bind)到节点,在我的情况下,我在节点内有多个链接。

下面是我的html:

    <div ui-tree="treeOptions" drag-delay="1000" id="tree-root">
<ol ui-tree-nodes ng-model="filteredModules" data-nodrop>
<li ng-repeat="module in filteredModules" ui-tree-node>
<div ui-tree-handle ng-click="toggle(this)">
<a class="btn btn-xs"><span class="glyphicon" ng-class="{'glyphicon-chevron-right': collapsed, 'glyphicon-chevron-down': !collapsed}"></span></a>
{{module.name}}
</div>
<ol ui-tree-nodes ng-model="module.stages" data-nodrop ng-class="{hidden: collapsed}">
<li ng-repeat="stage in module.stages" ui-tree-node>
<div ui-tree-handle ng-click="toggle(this)">
<a class="btn btn-xs"><span class="glyphicon" ng-class="{'glyphicon-chevron-right': collapsed, 'glyphicon-chevron-down': !collapsed}"></span></a>
{{stage.name}}
</div>
<div ui-tree-nodes ng-model="stage.cases" ng-class="{hidden: collapsed}">
<div ng-repeat="case in stage.cases" ui-tree-node>
<div ui-tree-handle>

<!-- HERE I HAVE TWO LINKS -->

<a href="/#/admin/cases/{{case._id}}">{{case.name}}</a>
<a href="/#/admin/cases/edit/{{case._id}}" class="pull-right btn btn-primary btn-xs"><span class="glyphicon glyphicon-edit"></span> Edit</a>
</div>
</div>
</div>
</li>
</ol>
</li>
</ol>
</div>

有没有办法在可拖动节点内有多个链接?

提前致谢

最佳答案

将 no-drag 属性添加到链接中,如下所示:

<a data-nodrag href="/#/admin/cases/{{case._id}}">{{case.name}}</a>                       
<a data-nodrag href="/#/admin/cases/edit/{{case._id}}" class="pull-right btn btn-primary btn-xs"><span class="glyphicon glyphicon-edit"></span> Edit</a>

关于angularjs - angular-ui-tree 中可拖动节点中的可点击链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29240923/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com