如何停止cdkDropList中的自动排列功能

时间:2019-04-16 16:55:44

标签: angular drag-and-drop

我想将一个项目拖放到cdkDropList中,但不希望这些项目在列表中自动排列。想要在中间或右边放置一个项目并保留该位置。现在,当我释放鼠标时,它会自动变为最接近的可用左对齐空间。

<div cdkDropList [cdkDropListData]="items" cdkDropListDropped)="drop($event)">
    <div cdkDrag [cdkDragData]="item" *ngFor="let item of items;">
        {{item.name}}
    </div>
</div>

0 个答案:

没有答案