【发布时间】:2021-07-22 07:20:19
【问题描述】:
我是 CropperJs 的新手。我正在开发一个 Angular 应用程序,我想显示 CropperJs 预览而不显示实际的裁剪器。
这可能吗?我怎么了?
这是我的代码:
HTML:
<div class="preview">
<img
#image
[src]="urlSafe"
/>
</div>
组件:
public cropper: any;
@ViewChild('image', { static: false })
public image: ElementRef;
this.cropper = new Cropper(this.image.nativeElement, { preview: '.preview' });
this.cropper.setAspectRatio(this.selectedRatio.value);
有人可以帮忙吗?
编辑:我在这里整理了一个堆栈闪电战:https://stackblitz.com/edit/angular-ivy-xerqiw?file=src%2Fapp%2Fpreview%2Fpreview.component.ts
有人可以看看吗?
【问题讨论】:
标签: cropperjs