選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 

26 行
572 B

  1. const BAIDU_HM_ID = '1cafaa94863718681ae361aa0b209ce7'
  2. export default defineNuxtPlugin(() => {
  3. window._hmt = window._hmt || []
  4. useHead({
  5. script: [
  6. {
  7. key: 'baidu-hm',
  8. src: `https://hm.baidu.com/hm.js?${BAIDU_HM_ID}`,
  9. async: true,
  10. },
  11. ],
  12. })
  13. const router = useRouter()
  14. let lastFullPath = router.currentRoute.value.fullPath
  15. router.afterEach((to, _from, failure) => {
  16. if (failure || to.fullPath === lastFullPath) return
  17. lastFullPath = to.fullPath
  18. window._hmt.push(['_trackPageview', to.fullPath])
  19. })
  20. })