網(wǎng)友評分:
9分
上海協(xié)卡助手 V3.6.8.0 官方免費(fèi)版
iSlide插件 V8.1.1.0 最新版
yaahp(層次分析軟件) V12.17.7993.25808 官方免費(fèi)版
Infinity新標(biāo)簽頁P(yáng)ro V10.0.109 最新免費(fèi)版
Ant Design Pro(UI設(shè)計語言和React組件庫) V4.21.3 官方版
壹伴小插件 V11.0.7 官方電腦版
不做手機(jī)控 V5.9.28.7 最新PC版
趕集直招PC客戶端 V10.20.56 最新免費(fèi)版
Redux DevTools是Chrome瀏覽器中的一款調(diào)試插件,它可以用于調(diào)試應(yīng)用程序的狀態(tài)更改,我們可以清晰的看到當(dāng)前store倉庫中的state是怎么樣的,在可視化工具的左邊,我們還可以看到觸發(fā)的action的變化!
1、在使用Chrome Redux調(diào)試插件之前,我們需要做一些項目的基本配置。我們要安裝到項目的一些基本使用,如: react、redux、react-redux等?;究蚣苋缦?
import Redux from 'redux'
// 引入createStore創(chuàng)建store,引入applyMiddleware 來使用中間件
import {createStore, applyMiddleware} from 'redux'
// 引入所有的reducer
import storeReducer from '../Reducer/index.jsx'
export default createStore(storeReducer);
2、下載安裝redux-devtools。
3、要想使用chrome redux調(diào)試插件,還需要在項目中安裝 redux-devtools-extension 插件。其安裝方法如下:
即在項目中直接執(zhí)行下面的安裝命令:
npm install redux-devtools-extension --save-dev
4、安裝成功后,還需要redux-devtools在項目中的配置,實際上就是在創(chuàng)建store的時候把redux-devtools安裝即可。
import Redux from 'redux'
// 引入createStore創(chuàng)建store,引入applyMiddleware 來使用中間件
import {createStore, applyMiddleware} from 'redux'
// 引入所有的reducer
import storeReducer from '../Reducer/index.jsx'
// 利用redux-logger打印日志
import {createLogger} from 'redux-logger'
// 安裝redux-devtools-extension的可視化工具。
import { composeWithDevTools } from 'redux-devtools-extension'
// 使用日志打印方法, collapsed讓action折疊,看著舒服。
const loggerMiddleware = createLogger({collapsed: true});
export default createStore(
storeReducer,
composeWithDevTools( )
);
標(biāo)簽: chrome插件
關(guān)于本站|下載幫助|下載聲明|軟件發(fā)布|聯(lián)系我們
Copyright ? 2005-2025 m.daaijiaoyu.cn.All rights reserved.
浙ICP備2024132706號-1 浙公網(wǎng)安備33038102330474號