【Bug Fix】TypeScript 中 使用 ResizeObserver: TS2304: Cannot find name 'ResizeObserver'.

1、yarn add @types/resize-observer-browser -D

 {

  "extends": "./tsconfig.json",
  "compilerOptions": {
    "typeRoots": ["node_modules/@types"],
    "types": ["resize-observer-browser"],
  }
}

解决方案

https://stackoverflow.com/questions/60270925/finding-resizeobserver-with-typescript-in-angular-9

posted @ 2021-09-13 18:21  Faron  阅读(1608)  评论(0编辑  收藏  举报