0
ドラッグイベントを明示的に発生させる必要のある角型アプリケーションがあります。私はAOT - ngcとロールアップを使用しています。 Typescript DragEvent構文
let event1 = new DragEvent();
event1.initDragEvent('dragstart', true, true, null, null, null, null, null, null, null, null, null, null, null, null, null);
this._renderer.invokeElementMethod(this._elementRef.nativeElement, 'dispatchEvent', [event1]);
Failed to construct 'DragEvent': 1 argument required, but only 0 present.
:
let event1 = new DragEvent('dragstart');
this._renderer.invokeElementMethod(this._elementRef.nativeElement, 'dispatchEvent', [event1]);
Expected 0 arguments, but got 1.
どのようにこの問題を解決できますか?
これは機能しませんでした。エラー==> 0引数が必要ですが、3があります。 –
'object.createEvent(event1);'を使用してイベントを初期化してみてください: 'new DragEvent(); ' –
どういう意味がわかりません。オブジェクトとは - ネイティブ要素ですか?イベント1はどのようにインスタンス化されるべきですか?数行のコードを提供していただけますか? –