且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

导入 *.svg 模块会引发 Typescript 错误:“找不到模块......"

更新时间:2022-12-10 10:59:55

Harshal Patil 的回答有效,但我使用了这里的内容:官方文档

Harshal Patil's answer worked, except I used what was here instead: Official Documentation

declare module '*.svg' {
  import Vue, {VueConstructor} from 'vue';
  const content: VueConstructor<Vue>;
  export default content;
}