我出错了
content-script.js:24 Uncaught (in promise) DOMException: Failed to execute 'postMessage' on 'Window': An object could not be cloned.
at Object.t.messageJumpContext (chrome-extension://elgalmkoelokbchhkhacckoklkejnhcd/build/content-script.js:24:9921)
at chrome-extension://elgalmkoelokbchhkhacckoklkejnhcd/build/content-script.js:24:8583
Run Code Online (Sandbox Code Playgroud)
我在代码中的任何地方都没有使用window.postMessage。知道为什么会这样吗?
我需要使用 angular-cdk 制作可拖动的项目。我已经在 app 模块中导入了 DragDropModule。我正在 ngFor 中应用 cdkDrag。
<div *ngIf="messages.length" >
<div
*ngFor="let message of messages" cdkDrag>
<strong>{{ message }}</strong>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
拖动没有按预期工作,控制台中也没有出现错误。拖动功能适用于普通 div 元素。