本文整理匯總了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}`);
})