Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
najiu-admin-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
najiu-frontend
najiu-admin-template
Commits
e04aaa06
Commit
e04aaa06
authored
Nov 26, 2020
by
vben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(use-redo): refresh the page to keep the parameters(#104)
parent
2f75a948
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
9 additions
and
24 deletions
+9
-24
CHANGELOG.zh_CN.md
CHANGELOG.zh_CN.md
+1
-0
usePage.ts
src/hooks/web/usePage.ts
+3
-0
useTitle.ts
src/hooks/web/useTitle.ts
+0
-18
page.ts
src/locales/lang/en/routes/demo/page.ts
+1
-0
page.ts
src/locales/lang/zh_CN/routes/demo/page.ts
+1
-0
index.ts
src/router/guard/index.ts
+1
-1
page.ts
src/router/routes/modules/demo/page.ts
+1
-1
index.vue
src/views/sys/redirect/index.vue
+1
-4
No files found.
CHANGELOG.zh_CN.md
View file @
e04aaa06
...
...
@@ -22,6 +22,7 @@
### 🐛 Bug Fixes
-
修复 tree 文本超出挡住操作按钮问题
-
修复通过 useRedo 刷新页面参数丢失问题
### 🎫 Chores
...
...
src/hooks/web/usePage.ts
View file @
e04aaa06
...
...
@@ -36,9 +36,12 @@ export function useGo() {
*/
export
const
useRedo
=
()
=>
{
const
{
push
,
currentRoute
}
=
useRouter
();
const
{
query
,
params
}
=
currentRoute
.
value
;
function
redo
()
{
push
({
path
:
'
/redirect
'
+
unref
(
currentRoute
).
fullPath
,
query
,
params
,
});
}
return
redo
;
...
...
src/hooks/web/useTitle.ts
deleted
100644 → 0
View file @
2f75a948
import
{
watch
}
from
'
vue
'
;
import
{
useRouter
}
from
'
vue-router
'
;
import
{
useGlobSetting
}
from
'
../setting
'
;
import
{
useI18n
}
from
'
./useI18n
'
;
import
{
setTitle
}
from
'
/@/utils/browser
'
;
export
function
useTitle
()
{
const
{
currentRoute
}
=
useRouter
();
const
{
t
}
=
useI18n
();
watch
(
()
=>
currentRoute
.
value
.
path
,
()
=>
{
const
globSetting
=
useGlobSetting
();
setTitle
(
t
(
currentRoute
.
value
.
meta
.
title
),
globSetting
.
title
);
},
{
immediate
:
true
,
flush
:
'
post
'
}
);
}
src/locales/lang/en/routes/demo/page.ts
View file @
e04aaa06
...
...
@@ -24,4 +24,5 @@ export default {
list
:
'
List page
'
,
listCard
:
'
Card list
'
,
basic
:
'
Basic list
'
,
};
src/locales/lang/zh_CN/routes/demo/page.ts
View file @
e04aaa06
...
...
@@ -24,4 +24,5 @@ export default {
list
:
'
列表页
'
,
listCard
:
'
卡片列表
'
,
basic
:
'
标准列表
'
,
};
src/router/guard/index.ts
View file @
e04aaa06
...
...
@@ -57,7 +57,7 @@ export function createGuard(router: Router) {
router
.
afterEach
((
to
)
=>
{
const
{
t
}
=
useI18n
();
// change html title
setTitle
(
t
(
to
.
meta
.
title
),
globSetting
.
title
);
to
.
name
!==
'
Redirect
'
&&
setTitle
(
t
(
to
.
meta
.
title
),
globSetting
.
title
);
});
createProgressGuard
(
router
);
createPermissionGuard
(
router
);
...
...
src/router/routes/modules/demo/page.ts
View file @
e04aaa06
...
...
@@ -223,7 +223,7 @@ const page: AppRouteModule = {
name
:
'
ListBasicPage
'
,
component
:
()
=>
import
(
'
/@/views/demo/page/list/basic/index.vue
'
),
meta
:
{
title
:
'
标准列表
'
,
title
:
'
routes.demo.page.basic
'
,
},
},
{
...
...
src/views/sys/redirect/index.vue
View file @
e04aaa06
<
template
>
<div
/>
</
template
>
<
script
lang=
"ts"
>
import
{
defineComponent
,
unref
}
from
'
vue
'
;
...
...
@@ -26,7 +23,7 @@
appStore
.
setPageLoadingAction
(
false
);
},
0
);
}
return
{}
;
return
()
=>
null
;
},
});
</
script
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment