<input type="text" name="copyInput" id="copyInput" [(ngModel)]="copyvalue"
style="position: absolute;left:-100px;bottom:-100px">
public toCopy(item) {
const input = this.el.nativeElement.querySelector(‘#copyInput‘);
this.copyvalue = item.url;
input.value = item.url;
input.select();
document.execCommand(‘Copy‘);
this._message.success(‘复制成功‘);
}
constructor(
private el: ElementRef
) {}