本文整理汇总了TypeScript中react-router.hashHistory类的典型用法代码示例。如果您正苦于以下问题:TypeScript hashHistory类的具体用法?TypeScript hashHistory怎么用?TypeScript hashHistory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了hashHistory类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: navigateToRoute
function navigateToRoute(navigationInfo: NavigationInfo){
if(navigationInfo.succeeded && navigationInfo.successNavigationRoute) {
hashHistory.push(navigationInfo.successNavigationRoute);
} else if(navigationInfo.errorNavigationRoute) {
hashHistory.push(navigationInfo.errorNavigationRoute);
}
}
示例2: handleServerError
export function handleServerError(response: Response, dispatch: Function, failureAction: Function, customErrorMessage: string = null) {
dispatch(failureAction());
dispatch(invalidateError());
dispatch(setError(response.status, response.statusText, customErrorMessage));
hashHistory.push("/error");
}
示例3: push
/**
* 页面跳转
*/
static push (url){
if (url.indexOf('http') != -1) {
window.location.href = url;
return false;
}
hashHistory.push(url);
}
示例4: AppReducer
export default function AppReducer(state = AppState, action) {
switch (action.type) {
case 'router-open':
if (state.path!=action.path) {
hashHistory.push(action.path);
return Object.assign({}, state, { path: action.path });
}
return state;
default:
return state;
};
}
示例5: dispatch
DataSource.students.update(editedStudent).then(updatedStudent => {
dispatch(commonActionCreators.finishTalkingToTheServer());
hashHistory.push('/students');
toastr.success('Student updated');
});
示例6: dispatch
.then(() => {
dispatch(loginSuccess());
hashHistory.push(typeof returnUrl !== "undefined" ? returnUrl : "/");
})
示例7: dispatch
.then(json => {
dispatch(createCountdownSuccess());
hashHistory.push(`/countdown/${json.Id}`);
})