我遵循下一个示例:
https://github.com/ant-design/ant-design/blob/master/components/form/demo/normal-login.md
组件的代码和样式表分开描述。我必须如何在反应组件中包含 css?
我尝试创建一个login.css
文件:
#components-form-demo-normal-login .login-form {
max-width: 300px;
}
#components-form-demo-normal-login .login-form-forgot {
float: right;
}
#components-form-demo-normal-login .login-form-button {
width: 100%;
}
然后将一个className
(提交按钮)修改为:
import styles from './login.css';
<Button type="primary" htmlType="submit" className={styles.login-form-button}>
Log in
</Button>
但是 webpack 告诉我:
42:76 error 'form' is not defined no-undef
42:81 error 'button' is not defined no-undef
如何包含样式表?