2

从父组件拖到一些子组件(多个相同类型的子组件)我(cdkDropListDropped)="drop($event)"用来指向:

  drop(event: CdkDragDrop<string[]>) {
    console.log(event);// how can i get the instance of target component
    }

<app-parent>
<div cdkDropList [cdkDropListData]="Data" (cdkDropListDropped)="drop($event)"></div>
<app-child cdkDropList></app-child> 
<app-child cdkDropList></app-child> 
<app-child cdkDropList></app-child> 
</app-parent>

但我无法从event目标组件中获取;

4

0 回答 0