Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
mlaj
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
2025-06-12 10:50:08 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f9549e83d3b094015bcfda7404e881c7a1321310
f9549e83
1 parent
45f88b97
fix(router): 修复路由切换后页面滚动位置问题
始终滚动到页面顶部,忽略之前保存的位置
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
33 deletions
src/components.d.ts
src/router/index.js
src/components.d.ts
View file @
f9549e8
...
...
@@ -29,38 +29,6 @@ declare module 'vue' {
TermsPopup
:
typeof
import
(
'./components/ui/TermsPopup.vue'
)[
'default'
]
UploadVideoPopup
:
typeof
import
(
'./components/ui/UploadVideoPopup.vue'
)[
'default'
]
UserAgreement
:
typeof
import
(
'./components/ui/UserAgreement.vue'
)[
'default'
]
VanActionSheet
:
typeof
import
(
'vant/es'
)[
'ActionSheet'
]
VanButton
:
typeof
import
(
'vant/es'
)[
'Button'
]
VanCalendar
:
typeof
import
(
'vant/es'
)[
'Calendar'
]
VanCellGroup
:
typeof
import
(
'vant/es'
)[
'CellGroup'
]
VanCheckbox
:
typeof
import
(
'vant/es'
)[
'Checkbox'
]
VanCol
:
typeof
import
(
'vant/es'
)[
'Col'
]
VanConfigProvider
:
typeof
import
(
'vant/es'
)[
'ConfigProvider'
]
VanDatePicker
:
typeof
import
(
'vant/es'
)[
'DatePicker'
]
VanDialog
:
typeof
import
(
'vant/es'
)[
'Dialog'
]
VanDivider
:
typeof
import
(
'vant/es'
)[
'Divider'
]
VanEmpty
:
typeof
import
(
'vant/es'
)[
'Empty'
]
VanField
:
typeof
import
(
'vant/es'
)[
'Field'
]
VanForm
:
typeof
import
(
'vant/es'
)[
'Form'
]
VanIcon
:
typeof
import
(
'vant/es'
)[
'Icon'
]
VanImage
:
typeof
import
(
'vant/es'
)[
'Image'
]
VanImagePreview
:
typeof
import
(
'vant/es'
)[
'ImagePreview'
]
VanList
:
typeof
import
(
'vant/es'
)[
'List'
]
VanLoading
:
typeof
import
(
'vant/es'
)[
'Loading'
]
VanNavBar
:
typeof
import
(
'vant/es'
)[
'NavBar'
]
VanOverlay
:
typeof
import
(
'vant/es'
)[
'Overlay'
]
VanPicker
:
typeof
import
(
'vant/es'
)[
'Picker'
]
VanPickerGroup
:
typeof
import
(
'vant/es'
)[
'PickerGroup'
]
VanPopup
:
typeof
import
(
'vant/es'
)[
'Popup'
]
VanProgress
:
typeof
import
(
'vant/es'
)[
'Progress'
]
VanRate
:
typeof
import
(
'vant/es'
)[
'Rate'
]
VanRow
:
typeof
import
(
'vant/es'
)[
'Row'
]
VanSwipe
:
typeof
import
(
'vant/es'
)[
'Swipe'
]
VanSwipeItem
:
typeof
import
(
'vant/es'
)[
'SwipeItem'
]
VanTab
:
typeof
import
(
'vant/es'
)[
'Tab'
]
VanTabs
:
typeof
import
(
'vant/es'
)[
'Tabs'
]
VanTag
:
typeof
import
(
'vant/es'
)[
'Tag'
]
VanUploader
:
typeof
import
(
'vant/es'
)[
'Uploader'
]
VideoPlayer
:
typeof
import
(
'./components/ui/VideoPlayer.vue'
)[
'default'
]
WechatPayment
:
typeof
import
(
'./components/payment/WechatPayment.vue'
)[
'default'
]
}
...
...
src/router/index.js
View file @
f9549e8
...
...
@@ -14,7 +14,8 @@ const router = createRouter({
routes
,
scrollBehavior
(
to
,
from
,
savedPosition
)
{
// 每次路由切换后,页面滚动到顶部
return
savedPosition
||
{
top
:
0
,
left
:
0
}
// return savedPosition || { top: 0, left: 0 }
return
{
top
:
0
,
left
:
0
}
},
})
...
...
Please
register
or
login
to post a comment