【发布时间】:2020-07-30 09:54:26
【问题描述】:
我目前正在使用 React 构建一个项目,并且我正在为单个组件使用 CSS 模块。
在我的公共文件夹中,我有/images/Background.png。
在 App.module.css 中,我有以下内容;
.Container {
background: url("./images/Background.png");
}
但是,这会引发以下错误;
Can't resolve './images/Background.png' in 'C:\Users\Me\Documents\Projects\Test\app\src\components\styles'
我应该如何使用 CSS 模块访问公用文件夹的内容?
【问题讨论】:
标签: css reactjs typescript