Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
tswj
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2022-05-18 16:32:42 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0b32d837cd933db2dce6b3e06e6a9eba0da9416d
0b32d837
1 parent
8addf0d2
缓存清空记录
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
src/store/index.js
src/views/client/chooseBook.vue
src/store/index.js
View file @
0b32d83
...
...
@@ -43,8 +43,8 @@ export const mainStore = defineStore('main', {
changeScrollTopPerson
(
v
)
{
this
.
scrollTopPerson
=
v
;
},
changeKeepPages
(
page
)
{
// 清空所有缓存,用一个不存在的值覆盖
this
.
keepPages
=
page
;
changeKeepPages
()
{
// 清空所有缓存,用一个不存在的值覆盖
this
.
keepPages
=
'default'
;
},
keepThisPage
(
page
)
{
// 新增缓存页
const
arr
=
this
.
keepPages
.
split
(
","
);
...
...
src/views/client/chooseBook.vue
View file @
0b32d83
...
...
@@ -61,7 +61,9 @@ const $router = useRouter();
// 删除所有的 keep-alive 缓存
const store = mainStore()
store.changeKeepPages('clear');
store.changeKeepPages();
// 清空记录位置
store.changeScrollTop(0);
// 设置页面标题
useTitle($route.meta.title)
...
...
Please
register
or
login
to post a comment