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-16 08:58:23 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b1e04a42e724e7826d156ea16c306e68998a2fe5
b1e04a42
1 parent
6c910102
个人中心记录位置
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
src/views/client/personIndex.vue
src/views/client/personIndex.vue
View file @
b1e04a4
...
...
@@ -70,6 +70,7 @@ import { ref, onActivated, onMounted } from 'vue'
import { useRoute, useRouter, onBeforeRouteLeave } from 'vue-router'
import axios from '@/utils/axios';
import _ from 'lodash';
import $ from 'jquery'
import { Toast } from 'vant';
const $route = useRoute();
...
...
@@ -154,6 +155,26 @@ onActivated(() => { // keepAlive 重置后执行回调
})
// 触发更新
userInfo.value.prod = arr.value;
const { scrollTop } = storeToRefs(store);
// 嵌套滚动,执行两个,先滚外面再滚里面
_.times(2, () => {
$("html,body").animate({ "scrollTop": String(scrollTop.value) + 'px' });
});
// 监听记录滚动位置
window.addEventListener('scroll',()=>{
if (window.scrollY) {
store.changeScrollTop(window.scrollY)
}
});
});
// 监听记录滚动位置
window.addEventListener('scroll',()=>{
if (window.scrollY) {
store.changeScrollTop(window.scrollY)
}
});
/*********************************************************/
...
...
Please
register
or
login
to post a comment