Showing
2 changed files
with
5 additions
and
3 deletions
| ... | @@ -43,8 +43,8 @@ export const mainStore = defineStore('main', { | ... | @@ -43,8 +43,8 @@ export const mainStore = defineStore('main', { |
| 43 | changeScrollTopPerson (v) { | 43 | changeScrollTopPerson (v) { |
| 44 | this.scrollTopPerson = v; | 44 | this.scrollTopPerson = v; |
| 45 | }, | 45 | }, |
| 46 | - changeKeepPages (page) { // 清空所有缓存,用一个不存在的值覆盖 | 46 | + changeKeepPages () { // 清空所有缓存,用一个不存在的值覆盖 |
| 47 | - this.keepPages = page; | 47 | + this.keepPages = 'default'; |
| 48 | }, | 48 | }, |
| 49 | keepThisPage (page) { // 新增缓存页 | 49 | keepThisPage (page) { // 新增缓存页 |
| 50 | const arr = this.keepPages.split(","); | 50 | const arr = this.keepPages.split(","); | ... | ... |
| ... | @@ -61,7 +61,9 @@ const $router = useRouter(); | ... | @@ -61,7 +61,9 @@ const $router = useRouter(); |
| 61 | 61 | ||
| 62 | // 删除所有的 keep-alive 缓存 | 62 | // 删除所有的 keep-alive 缓存 |
| 63 | const store = mainStore() | 63 | const store = mainStore() |
| 64 | -store.changeKeepPages('clear'); | 64 | +store.changeKeepPages(); |
| 65 | +// 清空记录位置 | ||
| 66 | +store.changeScrollTop(0); | ||
| 65 | 67 | ||
| 66 | // 设置页面标题 | 68 | // 设置页面标题 |
| 67 | useTitle($route.meta.title) | 69 | useTitle($route.meta.title) | ... | ... |
-
Please register or login to post a comment