0

typescript怎么引入图片?

   import img from "../../images/shop-list/shop-list-0.jpeg"
   报错了这句话    Cannot find module '../../images/shop-list/shop-list-0.jpeg'.
    
   用require   
   const img = require("../../images/shop-list/shop-list-0.jpeg")
   也报错         require statement not part of an import statement

   Stack Overflow的方法
   declare function require(string): string;  
   也会报错        variable name clashes with keyword/type

搞不懂了

2018-12-06 提问

1 个回答

你可能感兴趣的

推广链接