云
3 天以前 a220aed4949e1ba8e2d72e0e7463c7d5b85594e4
src/router/index.ts
@@ -9,6 +9,7 @@
import { createRouterGuard } from './guard';
import { routes } from './routes';
import { setupBaiduTongJi } from './tongji';
import { mobileScroll } from '#/mobile/scroll';
/**
 *  @zh_CN 创建vue-router实例
@@ -24,6 +25,8 @@
    if (savedPosition) {
      return savedPosition;
    }
    const mobilePosition=mobileScroll(to.path);
    if(mobilePosition)return mobilePosition;
    return to.hash ? { behavior: 'smooth', el: to.hash } : { left: 0, top: 0 };
  },
  // 是否应该禁止尾部斜杠。