typescript怎么引入圖片? import img from "../../images/shop-list/shop-list-0.jpeg"
報(bào)錯(cuò)了這句話 Cannot find module '../../images/shop-list/shop-list-0.jpeg'.
用require
const img = require("../../images/shop-list/shop-list-0.jpeg")
也報(bào)錯(cuò) require statement not part of an import statement
Stack Overflow的方法
declare function require(string): string;
也會(huì)報(bào)錯(cuò) variable name clashes with keyword/type搞不懂了
typescript import圖片報(bào)錯(cuò)
慕田峪7331174
2019-01-02 21:39:26