第一种:
(window as any).aaa
第二种:
declare global { interface Window { aaa: any; } } window.aaa = window.aaa || {};
第三种:
interface MyWindow extends Window { aaa(): void; } declare var window: MyWindow;
[ts] Property 'aaa' does not exist on type 'Window' 解决办法
原文地址:https://www.cnblogs.com/ldld/p/10270663.html
时间: 2024-10-30 09:22:22