提交 a299e9bf 编写于 作者: zcdtk's avatar zcdtk

路由视图参数处理异常修复

上级 8e2db488
...@@ -314,11 +314,15 @@ export class ViewTool { ...@@ -314,11 +314,15 @@ export class ViewTool {
const curReg = view.$pathToRegExp.pathToRegexp(path, keys); const curReg = view.$pathToRegExp.pathToRegexp(path, keys);
const matchArray = curReg.exec(view.$route.path); const matchArray = curReg.exec(view.$route.path);
keys.forEach((item: any, index: number) => { keys.forEach((item: any, index: number) => {
Object.defineProperty(_context, item.name, { Object.assign(_context, { [item.name]: matchArray[index + 1] });
enumerable: true,
value: matchArray[index + 1]
});
}); });
if (_context.hasOwnProperty('viewshell')) {
let viewshell: string = _context['viewshell'];
if (!Object.is(viewshell, 'null')) {
_context = { ..._context, ...qs.parse(viewshell) }
}
delete _context.viewshell;
}
if (view.$route && view.$route.fullPath && view.$route.fullPath.indexOf("?") > -1) { if (view.$route && view.$route.fullPath && view.$route.fullPath.indexOf("?") > -1) {
const viewParamStr = view.$route.fullPath.slice(view.$route.fullPath.indexOf("?") + 1); const viewParamStr = view.$route.fullPath.slice(view.$route.fullPath.indexOf("?") + 1);
_param = { ..._param, ...qs.parse(viewParamStr, { delimiter: '&' }) }; _param = { ..._param, ...qs.parse(viewParamStr, { delimiter: '&' }) };
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册