創(chuàng)建react項(xiàng)目時(shí)報(bào)錯(cuò)
error postcss@8.1.4: The engine "node" is incompatible with this module. Expected version "^10 || ^12 || >=14". Got "13.8.0"
在創(chuàng)建項(xiàng)目之前執(zhí)行以下命令:yarn config set ignore-engines true
引入ant-design
安裝:
yarn add antd -S
在index.js 引入:
import?'antd/dist/antd.css'
頁(yè)面中使用:
import { Button } from 'antd';
<Button type="primary">按鈕</Button>
create-react-app 創(chuàng)建的 react項(xiàng)目,默認(rèn)就是支持Sass的,使用只需要安裝一下 node-sass 這個(gè)包即可使用? (使用less稍微復(fù)雜)
npm install node-sass -D

運(yùn)行報(bào)錯(cuò)
卸載npm uninstall node-sass -D 并重新安裝?npm install node-sass@4.14.1
react 項(xiàng)目樣式采用css module?
命名方式 【name】.module.css