GC变量通过script标签引入的第三方引入,但是ts-plugin并不知道,需要明确声明这个变量的类型

vue3+ts+vite项目报错:找不到名称“GC”。ts-plugin(2304)_人工智能

vue3+ts+vite项目报错:找不到名称“GC”。ts-plugin(2304)_前端_02

 

/// <reference types="vite/client" />

declare module "*.vue" {
  import type { DefineComponent } from "vue";
  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
  const component: DefineComponent<{}, {}, any>;
  export default component;
}

declare module '@grapecity-software/spread-sheets-vue';

declare const GC: any
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.