zoukankan      html  css  js  c++  java
  • vue 声明式埋点

    1.vue入口,新增命令

    2.页面暴露埋点

    // The Vue build version to load with the `import` command
    // (runtime-only or standalone) has been set in webpack.base.conf with an alias.
    import Vue from 'vue'
    import Vuex from 'vuex'
    import ElementUI from 'element-ui';
    import 'element-ui/lib/theme-chalk/index.css';
    import App from './App'
    import router from './router'
    import store from './components/store'
    
    Vue.config.productionTip = false
    Vue.use(ElementUI);
    Vue.use(Vuex);
    
    Vue.directive('log', {
      bind(el, binding) {
        el.addEventListener('click', () => {
          console.log(el.id)
          console.log(binding.value)
        }, false);
      }
    });
    /* eslint-disable no-new */
    new Vue({
      el: '#app',
      router,
      store,
      components: { App },
      template: '<App/>'
    })
    <template>
        <div>
          <h1>客户资料</h1>
    
          <el-button v-log="{page:'customer',event:'click',id:'btn1'}" id="btn1">测试</el-button>
        </div>
    </template>
    
    <script>
        export default {
            name: "customer"
        }
    </script>
    
    <style scoped>
    
    </style>

  • 相关阅读:
    续上-选课系统
    第一个java web的课堂练习-开始
    子类与父类方法间的关系
    课后作业-3
    小结
    Java中子类与基类变量间的赋值
    今日总结
    今日总结
    今日总结
    今日总结
  • 原文地址:https://www.cnblogs.com/ligenyun/p/12422357.html
Copyright © 2011-2022 走看看