首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >vue中友盟站长代码统计实现

vue中友盟站长代码统计实现

作者头像
故久
发布2019-09-29 14:52:42
8520
发布2019-09-29 14:52:42
举报
文章被收录于专栏:故久故久
<template>
<div class="footer" id="foot">
        <p id="test" class="company">{{$t('other.footerDes')}}</p>
</div>
</template>
mounted() {
const script = document.createElement('script')
script.src = 'https://s95.cnzz.com/z_stat.php?id=1256769433&web_id=1256769433'
script.language = 'JavaScript'
document.getElementById('test').appendChild(script)
const script1 = document.createElement('script')
script1.src = 'https://c.cnzz.com/core.php?web_id=1256769433&t=z'
script1.language = 'JavaScript'
document.getElementById('test').appendChild(script1)
const a = document.createElement('a')
a.href = 'https://www.cnzz.com/stat/website.php?web_id=1256769433'
a.text = ' 站长统计'
a.title = '站长统计'
a.style = 'font-size:14px;color:#FFFFFF'
document.getElementById('test').appendChild(a)
}
,watch: {
    '$route' () {
        if (window._czc) {
            let location = window.location
            let contentUrl = location.pathname + location.hash
            let refererUrl = '/'
            window._czc.push(['_trackPageview', contentUrl, refererUrl])
        }
    }
}

实现效果

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档