yapi/client/reducer/menu/menu.js

22 lines
366 B
JavaScript
Raw Normal View History

2017-07-20 21:30:35 +08:00
import {
CHANGE_MENU_ITEM
} from '../../constants/action-types.js'
const initialState = {
2017-07-25 17:56:04 +08:00
curKey: '/'+window.location.hash.split("/")[1]
2017-07-20 21:30:35 +08:00
}
export default (state = initialState, action) => {
switch (action.type) {
case CHANGE_MENU_ITEM: {
return {
...state,
curKey: action.data
};
}
default:
return state;
}
}