UNPKG

t-comm

Version:

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

27 lines (24 loc) 654 B
import _typeof from '@babel/runtime/helpers/typeof'; import { d as __rest } from '../tslib.es6-096fffdd.js'; /** * 根据路由跳转时的参数,提取 path 和其他参数 * @param route $router.push 或者 $router.replace 的参数 * @returns 解析结果 */ function getRouterFuncPath(route) { var rawPath; var rawOther = {}; if (_typeof(route) === 'object' && route.path) { rawPath = route.path; route.path; var other = __rest(route, ["path"]); rawOther = other; } else if (typeof route === 'string') { rawPath = route; } return { path: rawPath, other: rawOther }; } export { getRouterFuncPath };