javascript - How to use Umeng in vue?
仅有的幸福
仅有的幸福 2017-05-19 10:41:47
0
1
624

I introduced Umeng into the head of index.html, and when using it, an error message was reported _czc is undefined

    

        <script>
              //声明_czc对象:
              var _czc = _czc || [];
              //绑定siteid,请用您的siteid替换下方"XXXXXXXX"部分
              _czc.push(["_setAccount", "1261730196"]);
        </script>
        <script type="text/javascript"> 友盟中复制的代码 </script>
        
        我要统计一个按钮的点击量
        add: function () {
          _czc.push([ '_trackEvent', '官网点击量', '官网点击量', '官网点击量' ])
        }
        
        结果报错说_czc未定义。请问我要怎么引入?
仅有的幸福
仅有的幸福

reply all(1)
左手右手慢动作

If you are using webpack, you need to modify the configuration file
/build/webpack.base.conf.js

let webpackConfig = {
  externals: {
    "_czc": "_czc"
  }
  ...
}
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!