我正在设计我的反应应用程序。我正在使用带有 webpack 的 css 模块。这是我的配置:
{ test: /\.css$/, loaders: ["style", "css?modules"] },
我设计了我的组件,煮了一杯咖啡,但现在它不工作了。所以我有一个我想使用的样式表。我正在导入它:
import styles from "./search.css";
但是,当我打破我的组件时,styles
没有定义。我的样式现在都没有被应用。这是我如何使用它的示例:
// the chrome inspector only shows the first two styles, the last is not there
<div className={["col-md-2", "col-lg-1", styles.startTimes]}>
为什么会styles
是空的?