我正在尝试使用 css 模块为一个元素使用多个类。我该怎么做呢?
function Footer( props) {
const { route } = props;
return (
<div className={styles.footer}>
<div className={styles.description, styles.yellow}>
<p>this site was created by me</p>
</div>
<div className={styles.description}>
<p>copyright nz</p>
</div>
</div>
);
}
原文由 Navela 发布,翻译遵循 CC BY-SA 4.0 许可协议
您可以使用 css 模块添加多个类,如下所示:
例如
使用 react-css-modules 你可以使用普通的类名语法:
<div styleName='description yellow'>
并且您为多个类指定
allowMultiple: true