mirror of
https://github.com/ZiuChen/ZiuChen.github.io.git
synced 2025-12-20 01:35:38 +08:00
feat: 为页面跳转与路由切换添加埋点上报
This commit is contained in:
10
docs/.vuepress/enhanceApp.js
Normal file
10
docs/.vuepress/enhanceApp.js
Normal file
@@ -0,0 +1,10 @@
|
||||
export default ({ router }) => {
|
||||
router.beforeEach((to, from, next) => {
|
||||
if (typeof _hmt !== 'undefined') {
|
||||
if (to.path) {
|
||||
_hmt.push(['_trackPageview', to.fullPath]) // 添加埋点上报
|
||||
}
|
||||
}
|
||||
next() // 执行路由跳转
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user