上代碼
文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-685407.html
.m-nav-bar {
background: #171a21;
.content {
height: 104px;
margin: 0px auto;
}
}
import React from "react";
import styles from './css.module.scss'
export default class NavBar extends React.Component<any, any> {
constructor (props: any) {
super(props);
this.state = {
};
}
render () {
return (
<div className={styles['m-nav-bar']}>
<div className={styles['content']}>
內(nèi)容
</div>
</div>
);
}
}
導(dǎo)入的時(shí)候把名稱(chēng)改為
css.module.scss
文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-685407.html
到了這里,關(guān)于react css 污染解決方法的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!