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搞不懂了
typescript import圖片報錯
慕田峪7331174
2019-01-02 21:39:26