角度如何在拖动图像时更改背景放置区域的颜色

时间:2019-11-11 09:57:28

标签: angular typescript

我正在使用角度来插入和预览图像,但是我想在拖动图像时在拖放区中添加一种颜色..有人知道我该怎么实现吗?

MY Code StackBlitz

HTML

   <div cdkDropList (cdkDropListDropped)="drop($event)">
    <div class="drop" [style.border-width.px]="urls.length > 0 ? 0: 3">
      <div class="cont" *ngIf="urls.length === 0">
        <div class="browse" >
            Upload 
          </div>
      </div>
      <div class="abc" *ngIf="urls.length > 0">
          <img [src]="urls[0]" cdkDrag><span class="delete" style="cursor: pointer;" (click)="deleteImage(urls[0])">X</span>
      </div>
        <input type="file" id="files" multiple (change)="detectFiles($event)" accept="image/*">
    </div>
    </div>

0 个答案:

没有答案