vue3 路由设置滚动条置顶

const router = createRouter({

  history: createWebHistory(),

  routes,

  // 跳转路由后导航栏置顶

  scrollBehavior(to, from, saveScrollPosition) {

    return { left: 0, top: 0 };

  },

});

你可能感兴趣的:(vue,大前端,vue,router,route)