Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
球球不吃虾
vue-vben-admin
提交
2dd3d854
V
vue-vben-admin
项目概览
球球不吃虾
/
vue-vben-admin
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vue-vben-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
2dd3d854
编写于
8月 15, 2021
作者:
无
无木
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: fixed `useRedo` may loss route params
修复useRedo会丢失当前路由的params数据问题 fixed: #1079
上级
da12da9d
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
30 addition
and
18 deletion
+30
-18
CHANGELOG.zh_CN.md
CHANGELOG.zh_CN.md
+1
-0
src/components/Table/src/BasicTable.vue
src/components/Table/src/BasicTable.vue
+1
-1
src/hooks/web/usePage.ts
src/hooks/web/usePage.ts
+11
-11
src/router/routes/basic.ts
src/router/routes/basic.ts
+1
-1
src/views/sys/redirect/index.vue
src/views/sys/redirect/index.vue
+16
-5
未找到文件。
CHANGELOG.zh_CN.md
浏览文件 @
2dd3d854
...
...
@@ -17,6 +17,7 @@
-
修复在
`editComponentProps`
中为编辑组件提供的
`size`
属性无效的问题
-
**Qrcode**
修复二维码组件在创建时未能及时绘制的问题
-
**BasicModal**
修复
`helpMessage`
属性不起作用的问题
-
**其它**
修复
`useRedo`
(重新加载当前路由)会丢失路由
`params`
数据的问题
## 2.7.0(2021-08-03)
...
...
src/components/Table/src/BasicTable.vue
浏览文件 @
2dd3d854
...
...
@@ -110,7 +110,7 @@
watchEffect
(()
=>
{
unref
(
isFixedHeightPage
)
&&
props
.
canResize
&&
warn
(
"
[BasicTable] 'canR
ize' not worked with PageWrapper while 'fixedHeight' is true
"
);
warn
(
"
[BasicTable] 'canR
esize' may not worked in PageWrapper with 'fixedHeight'
"
);
});
const
{
getLoading
,
setLoading
}
=
useLoading
(
getProps
);
...
...
src/hooks/web/usePage.ts
浏览文件 @
2dd3d854
...
...
@@ -5,6 +5,7 @@ import { isString } from '/@/utils/is';
import
{
unref
}
from
'
vue
'
;
import
{
useRouter
}
from
'
vue-router
'
;
import
{
REDIRECT_NAME
}
from
'
/@/router/constant
'
;
export
type
RouteLocationRawEx
=
Omit
<
RouteLocationRaw
,
'
path
'
>
&
{
path
:
PageEnum
};
...
...
@@ -37,19 +38,18 @@ export function useGo(_router?: Router) {
* @description: redo current page
*/
export
const
useRedo
=
(
_router
?:
Router
)
=>
{
let
router
;
if
(
!
_router
)
{
router
=
useRouter
();
}
const
{
push
,
currentRoute
}
=
_router
||
router
;
const
{
query
,
params
}
=
currentRoute
.
value
;
const
{
push
,
currentRoute
}
=
_router
||
useRouter
();
const
{
query
,
params
=
{},
name
,
fullPath
}
=
unref
(
currentRoute
.
value
);
function
redo
():
Promise
<
boolean
>
{
return
new
Promise
((
resolve
)
=>
{
push
({
path
:
'
/redirect
'
+
unref
(
currentRoute
).
fullPath
,
query
,
params
,
}).
then
(()
=>
resolve
(
true
));
if
(
name
&&
Object
.
keys
(
params
).
length
>
0
)
{
params
[
'
_redirect_type
'
]
=
'
name
'
;
params
[
'
path
'
]
=
String
(
name
);
}
else
{
params
[
'
_redirect_type
'
]
=
'
path
'
;
params
[
'
path
'
]
=
fullPath
;
}
push
({
name
:
REDIRECT_NAME
,
params
,
query
}).
then
(()
=>
resolve
(
true
));
});
}
return
redo
;
...
...
src/router/routes/basic.ts
浏览文件 @
2dd3d854
...
...
@@ -33,8 +33,8 @@ export const PAGE_NOT_FOUND_ROUTE: AppRouteRecordRaw = {
export
const
REDIRECT_ROUTE
:
AppRouteRecordRaw
=
{
path
:
'
/redirect
'
,
name
:
REDIRECT_NAME
,
component
:
LAYOUT
,
name
:
'
RedirectTo
'
,
meta
:
{
title
:
REDIRECT_NAME
,
hideBreadcrumb
:
true
,
...
...
src/views/sys/redirect/index.vue
浏览文件 @
2dd3d854
...
...
@@ -8,12 +8,23 @@
const
{
currentRoute
,
replace
}
=
useRouter
();
const
{
params
,
query
}
=
unref
(
currentRoute
);
const
{
path
}
=
params
;
const
{
path
,
_redirect_type
=
'
path
'
}
=
params
;
Reflect
.
deleteProperty
(
params
,
'
_redirect_type
'
);
Reflect
.
deleteProperty
(
params
,
'
path
'
);
const
_path
=
Array
.
isArray
(
path
)
?
path
.
join
(
'
/
'
)
:
path
;
replace
({
path
:
'
/
'
+
_path
,
query
,
});
if
(
_redirect_type
===
'
name
'
)
{
replace
({
name
:
_path
,
query
,
params
,
});
}
else
{
replace
({
path
:
_path
.
startsWith
(
'
/
'
)
?
_path
:
'
/
'
+
_path
,
query
,
});
}
</
script
>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录