Commit 2b56ed04 authored by 前端-许佳敏's avatar 前端-许佳敏

路由切换时自动回到顶部

parent 90041bc7
......@@ -135,7 +135,9 @@ export function render(oldRender: Function) {
*/
export function onRouteChange({ routes, matchedRoutes, location, action }) {
console.log('onRouteChange')
// 路由切换时, 自动回到顶部
document.body.scrollTop = document.documentElement.scrollTop = 0
if (isDev) {
return;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment