Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
basic-vue-admin
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-vue-admin
Commits
2dd3d854
提交
2dd3d854
authored
8月 15, 2021
作者:
无木
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: fixed `useRedo` may loss route params
修复useRedo会丢失当前路由的params数据问题 fixed: #1079
上级
da12da9d
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
27 行增加
和
15 行删除
+27
-15
CHANGELOG.zh_CN.md
CHANGELOG.zh_CN.md
+1
-0
BasicTable.vue
src/components/Table/src/BasicTable.vue
+1
-1
usePage.ts
src/hooks/web/usePage.ts
+11
-11
basic.ts
src/router/routes/basic.ts
+1
-1
index.vue
src/views/sys/redirect/index.vue
+13
-2
没有找到文件。
CHANGELOG.zh_CN.md
浏览文件 @
2dd3d854
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
-
修复在
`editComponentProps`
中为编辑组件提供的
`size`
属性无效的问题
-
修复在
`editComponentProps`
中为编辑组件提供的
`size`
属性无效的问题
-
**Qrcode**
修复二维码组件在创建时未能及时绘制的问题
-
**Qrcode**
修复二维码组件在创建时未能及时绘制的问题
-
**BasicModal**
修复
`helpMessage`
属性不起作用的问题
-
**BasicModal**
修复
`helpMessage`
属性不起作用的问题
-
**其它**
修复
`useRedo`
(重新加载当前路由)会丢失路由
`params`
数据的问题
## 2.7.0(2021-08-03)
## 2.7.0(2021-08-03)
...
...
src/components/Table/src/BasicTable.vue
浏览文件 @
2dd3d854
...
@@ -110,7 +110,7 @@
...
@@ -110,7 +110,7 @@
watchEffect
(()
=>
{
watchEffect
(()
=>
{
unref
(
isFixedHeightPage
)
&&
unref
(
isFixedHeightPage
)
&&
props
.
canResize
&&
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
);
const
{
getLoading
,
setLoading
}
=
useLoading
(
getProps
);
...
...
src/hooks/web/usePage.ts
浏览文件 @
2dd3d854
...
@@ -5,6 +5,7 @@ import { isString } from '/@/utils/is';
...
@@ -5,6 +5,7 @@ import { isString } from '/@/utils/is';
import
{
unref
}
from
'vue'
;
import
{
unref
}
from
'vue'
;
import
{
useRouter
}
from
'vue-router'
;
import
{
useRouter
}
from
'vue-router'
;
import
{
REDIRECT_NAME
}
from
'/@/router/constant'
;
export
type
RouteLocationRawEx
=
Omit
<
RouteLocationRaw
,
'path'
>
&
{
path
:
PageEnum
};
export
type
RouteLocationRawEx
=
Omit
<
RouteLocationRaw
,
'path'
>
&
{
path
:
PageEnum
};
...
@@ -37,19 +38,18 @@ export function useGo(_router?: Router) {
...
@@ -37,19 +38,18 @@ export function useGo(_router?: Router) {
* @description: redo current page
* @description: redo current page
*/
*/
export
const
useRedo
=
(
_router
?:
Router
)
=>
{
export
const
useRedo
=
(
_router
?:
Router
)
=>
{
let
router
;
const
{
push
,
currentRoute
}
=
_router
||
useRouter
();
if
(
!
_router
)
{
const
{
query
,
params
=
{},
name
,
fullPath
}
=
unref
(
currentRoute
.
value
);
router
=
useRouter
();
}
const
{
push
,
currentRoute
}
=
_router
||
router
;
const
{
query
,
params
}
=
currentRoute
.
value
;
function
redo
():
Promise
<
boolean
>
{
function
redo
():
Promise
<
boolean
>
{
return
new
Promise
((
resolve
)
=>
{
return
new
Promise
((
resolve
)
=>
{
push
({
if
(
name
&&
Object
.
keys
(
params
).
length
>
0
)
{
path
:
'/redirect'
+
unref
(
currentRoute
).
fullPath
,
params
[
'_redirect_type'
]
=
'name'
;
query
,
params
[
'path'
]
=
String
(
name
);
params
,
}
else
{
}).
then
(()
=>
resolve
(
true
));
params
[
'_redirect_type'
]
=
'path'
;
params
[
'path'
]
=
fullPath
;
}
push
({
name
:
REDIRECT_NAME
,
params
,
query
}).
then
(()
=>
resolve
(
true
));
});
});
}
}
return
redo
;
return
redo
;
...
...
src/router/routes/basic.ts
浏览文件 @
2dd3d854
...
@@ -33,8 +33,8 @@ export const PAGE_NOT_FOUND_ROUTE: AppRouteRecordRaw = {
...
@@ -33,8 +33,8 @@ export const PAGE_NOT_FOUND_ROUTE: AppRouteRecordRaw = {
export
const
REDIRECT_ROUTE
:
AppRouteRecordRaw
=
{
export
const
REDIRECT_ROUTE
:
AppRouteRecordRaw
=
{
path
:
'/redirect'
,
path
:
'/redirect'
,
name
:
REDIRECT_NAME
,
component
:
LAYOUT
,
component
:
LAYOUT
,
name
:
'RedirectTo'
,
meta
:
{
meta
:
{
title
:
REDIRECT_NAME
,
title
:
REDIRECT_NAME
,
hideBreadcrumb
:
true
,
hideBreadcrumb
:
true
,
...
...
src/views/sys/redirect/index.vue
浏览文件 @
2dd3d854
...
@@ -8,12 +8,23 @@
...
@@ -8,12 +8,23 @@
const
{
currentRoute
,
replace
}
=
useRouter
();
const
{
currentRoute
,
replace
}
=
useRouter
();
const
{
params
,
query
}
=
unref
(
currentRoute
);
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
;
const
_path
=
Array
.
isArray
(
path
)
?
path
.
join
(
'/'
)
:
path
;
if
(
_redirect_type
===
'name'
)
{
replace
({
name
:
_path
,
query
,
params
,
});
}
else
{
replace
({
replace
({
path
:
'/'
+
_path
,
path
:
_path
.
startsWith
(
'/'
)
?
_path
:
'/'
+
_path
,
query
,
query
,
});
});
}
</
script
>
</
script
>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论