當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript createHashHistory.default函數代碼示例

本文整理匯總了TypeScript中history/createHashHistory.default函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript default函數的具體用法?TypeScript default怎麽用?TypeScript default使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了default函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: createHashHistory

import createHashHistory from "history/createHashHistory";

// TODO: Add user confirmation setting
export default createHashHistory();
開發者ID:cschleiden,項目名稱:vsts-estimate,代碼行數:4,代碼來源:history.ts

示例2: legacyEncodeURIComponent

interface RisonEncoded {
  _g?: string;
  _a?: string;
}

interface RisonDecoded {
  _g?: StringMap;
  _a?: StringMap;
}

export type QueryParams = APMQueryParams & RisonEncoded;
export type QueryParamsDecoded = APMQueryParams & RisonDecoded;

// This is downright horrible 😭 💔
// Angular decodes encoded url tokens like "%2F" to "/" which causes the route to change.
// It was supposedly fixed in https://github.com/angular/angular.js/commit/1b779028fdd339febaa1fff5f3bd4cfcda46cc09 but still seeing the issue
export function legacyEncodeURIComponent(rawUrl?: string) {
  return rawUrl && encodeURIComponent(rawUrl).replace(/%/g, '~');
}

export function legacyDecodeURIComponent(encodedUrl?: string) {
  return encodedUrl && decodeURIComponent(encodedUrl.replace(/~/g, '%'));
}

// Make history singleton available across APM project.
// This is not great. Other options are to use context or withRouter helper
// React Context API is unstable and will change soon-ish (probably 16.3)
// withRouter helper from react-router overrides several props (eg. `location`) which makes it less desireable
export const history = createHistory();
開發者ID:lucabelluccini,項目名稱:kibana,代碼行數:29,代碼來源:url_helpers.ts

示例3: createHistory

/*
 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
 * or more contributor license agreements. Licensed under the Elastic License;
 * you may not use this file except in compliance with the Elastic License.
 */

import createHistory from 'history/createHashHistory';

// Make history singleton available across APM project
// TODO: Explore using React context or hook instead?
const history = createHistory();

export { history };
開發者ID:elastic,項目名稱:kibana,代碼行數:13,代碼來源:history.ts


注:本文中的history/createHashHistory.default函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。