enhanceApp.js 356 B

123456789101112131415
  1. export default ({router}) => {
  2. /**
  3. * 路由切换事件处理
  4. */
  5. router.beforeEach((to, from, next) => {
  6. //触发百度的pv统计
  7. if (typeof _hmt != "undefined") {
  8. if (to.path) {
  9. _hmt.push(["_trackPageview", to.fullPath]);
  10. }
  11. }
  12. // continue
  13. next();
  14. });
  15. };