hookehuyr

fix(router): 修复路由切换后页面滚动位置问题

始终滚动到页面顶部,忽略之前保存的位置
...@@ -29,38 +29,6 @@ declare module 'vue' { ...@@ -29,38 +29,6 @@ declare module 'vue' {
29 TermsPopup: typeof import('./components/ui/TermsPopup.vue')['default'] 29 TermsPopup: typeof import('./components/ui/TermsPopup.vue')['default']
30 UploadVideoPopup: typeof import('./components/ui/UploadVideoPopup.vue')['default'] 30 UploadVideoPopup: typeof import('./components/ui/UploadVideoPopup.vue')['default']
31 UserAgreement: typeof import('./components/ui/UserAgreement.vue')['default'] 31 UserAgreement: typeof import('./components/ui/UserAgreement.vue')['default']
32 - VanActionSheet: typeof import('vant/es')['ActionSheet']
33 - VanButton: typeof import('vant/es')['Button']
34 - VanCalendar: typeof import('vant/es')['Calendar']
35 - VanCellGroup: typeof import('vant/es')['CellGroup']
36 - VanCheckbox: typeof import('vant/es')['Checkbox']
37 - VanCol: typeof import('vant/es')['Col']
38 - VanConfigProvider: typeof import('vant/es')['ConfigProvider']
39 - VanDatePicker: typeof import('vant/es')['DatePicker']
40 - VanDialog: typeof import('vant/es')['Dialog']
41 - VanDivider: typeof import('vant/es')['Divider']
42 - VanEmpty: typeof import('vant/es')['Empty']
43 - VanField: typeof import('vant/es')['Field']
44 - VanForm: typeof import('vant/es')['Form']
45 - VanIcon: typeof import('vant/es')['Icon']
46 - VanImage: typeof import('vant/es')['Image']
47 - VanImagePreview: typeof import('vant/es')['ImagePreview']
48 - VanList: typeof import('vant/es')['List']
49 - VanLoading: typeof import('vant/es')['Loading']
50 - VanNavBar: typeof import('vant/es')['NavBar']
51 - VanOverlay: typeof import('vant/es')['Overlay']
52 - VanPicker: typeof import('vant/es')['Picker']
53 - VanPickerGroup: typeof import('vant/es')['PickerGroup']
54 - VanPopup: typeof import('vant/es')['Popup']
55 - VanProgress: typeof import('vant/es')['Progress']
56 - VanRate: typeof import('vant/es')['Rate']
57 - VanRow: typeof import('vant/es')['Row']
58 - VanSwipe: typeof import('vant/es')['Swipe']
59 - VanSwipeItem: typeof import('vant/es')['SwipeItem']
60 - VanTab: typeof import('vant/es')['Tab']
61 - VanTabs: typeof import('vant/es')['Tabs']
62 - VanTag: typeof import('vant/es')['Tag']
63 - VanUploader: typeof import('vant/es')['Uploader']
64 VideoPlayer: typeof import('./components/ui/VideoPlayer.vue')['default'] 32 VideoPlayer: typeof import('./components/ui/VideoPlayer.vue')['default']
65 WechatPayment: typeof import('./components/payment/WechatPayment.vue')['default'] 33 WechatPayment: typeof import('./components/payment/WechatPayment.vue')['default']
66 } 34 }
......
...@@ -14,7 +14,8 @@ const router = createRouter({ ...@@ -14,7 +14,8 @@ const router = createRouter({
14 routes, 14 routes,
15 scrollBehavior(to, from, savedPosition) { 15 scrollBehavior(to, from, savedPosition) {
16 // 每次路由切换后,页面滚动到顶部 16 // 每次路由切换后,页面滚动到顶部
17 - return savedPosition || { top: 0, left: 0 } 17 + // return savedPosition || { top: 0, left: 0 }
18 + return { top: 0, left: 0 }
18 }, 19 },
19 }) 20 })
20 21
......