liu
4 天以前 ee7ac8df8bce38add1f75baf876b49de94b9e00a
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 };
  },
  // 是否应该禁止尾部斜杠。