在index.less里
.welcome {
height: 328px;
background: url(../assets/yay.jpg) no-repeat center 0;
background-size: 388px 328px;
}
:global {
.red {
background: red;
.yellow{
background: green;
}
}
}
在index.js里
import styles from './index.less';
export default function() {
return (
<div>
<div class='red'>
2233232
<div class="yellow">888</div>
</div>
<div className={styles.welcome}>
</div>
</div>
);
}