简体   繁体   中英

Drop zone directive for Angular CDK drag-drop

I am relatively new in Angular 2+ and I want to drag a div within another div. I am using Drag & Drop CDK and wrote the following code to do that;

<div cdkDrop>    
    <div cdkDrag class="wrapper">
         <header cdkDragHandle class="widget__header">{{ title }}</header>
         <section class="widget__content">{{ content }}</section>
     </div>
</div>

I read in this article that for having a drop zone, you just need to add cdkDrop directive to your div but it doesn't work for me although dragging is OK. Can anybody tell me how to define the drop zone?

我也发现了cdkDrop的同样问题,在google之后,我发现它重命名为cdkDropList sine v7.0.0-rc.2(2018-10-15),因此您可以改用它。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM