1、main.js
router.afterEach((to, from, next) => { window.scrollTo(0, 0); });
2、watch
watch: { route (newval, oldval) { if (newval.path === '/betting' || newval.path === '/trend' || newval.path === '/lotResult') { document.body.scrollTop = '200'; } this.setAllShow(false); } },