React專案需要安裝的第三方外掛或包隨手一記-----------------------------------------【鳳、獨影】
阿新 • • 發佈:2018-11-14
001:安裝腳手架工具
npm install -g create-react-app
002:建立新專案
create-react-app myproduct //myproduct 是建立資料夾的名稱
003:
01:node_modules用於存放專案的依賴包
02:src用於存放js檔案,專案開發中的主要區域
03:package.json用於記錄專案資訊和外部依賴包的資訊
04:js檔案不能直接開啟,需要用文字編輯器
004:cd到myproduct目錄下,部署npm,匯入react-dom包
cmd:
npm init (初始化)
npm install --save react react-dom (在此目錄下匯入react和react-dom)
npm install --save react-router-dom (react路由)
cnpm install flux --save-dev (安裝flux)
cnpm install redux --save-dev (安裝redux)
cnpm install redux-promise-middleware (安裝非同步action)
cnpm install swiper --save-dev (輪播)
cnpm install better-scroll --save-dev(安裝better)
cnpm install axios --save-dev (安裝axios)
005:啟動
npm run start