[ts] Property 'aaa' does not exist on type 'Window' 解决办法

2021-06-19 22:06

阅读:509

标签:har   csharp   extends   int   oid   not   sharp   lob   global   

 第一种:

(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' 解决办法

标签:har   csharp   extends   int   oid   not   sharp   lob   global   

原文地址:https://www.cnblogs.com/ldld/p/10270663.html


评论


亲,登录后才可以留言!