diff --git a/public/index.html b/public/index.html index 81ea083..c2eaf9c 100644 --- a/public/index.html +++ b/public/index.html @@ -11,7 +11,9 @@ - +
+ diff --git a/src/main.js b/src/main.js index e28bd66..66e71f5 100644 --- a/src/main.js +++ b/src/main.js @@ -43,4 +43,14 @@ new Vue({ router, store, render: h => h(App) -}) +}); + +// 加入百度统计 +router.beforeEach((to, from, next) => { + if (to.path) { + if (window._hmt) { + window._hmt.push(['_trackPageview', '/#' + to.fullPath]) + } + } + next() +});