UNPKG

t-comm

Version:

专业、稳定、纯粹的工具库

35 lines (28 loc) 965 B
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _typeof = require('@babel/runtime/helpers/typeof'); var tslib_es6 = require('../tslib.es6-01322ba9.js'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var _typeof__default = /*#__PURE__*/_interopDefaultLegacy(_typeof); /** * 根据路由跳转时的参数,提取 path 和其他参数 * @param route $router.push 或者 $router.replace 的参数 * @returns 解析结果 */ function getRouterFuncPath(route) { var rawPath; var rawOther = {}; if (_typeof__default["default"](route) === 'object' && route.path) { rawPath = route.path; route.path; var other = tslib_es6.__rest(route, ["path"]); rawOther = other; } else if (typeof route === 'string') { rawPath = route; } return { path: rawPath, other: rawOther }; } exports.getRouterFuncPath = getRouterFuncPath;