updated README

This commit is contained in:
Marvin Zhang
2019-05-30 19:18:56 +08:00
parent eb4a4ac06b
commit 6cd8d0585b
6 changed files with 39 additions and 12 deletions

View File

@@ -12,8 +12,6 @@ import 'font-awesome/scss/font-awesome.scss'// FontAwesome
import 'codemirror/lib/codemirror.css'
// import ba from 'vue-ba'
import App from './App'
import store from './store'
import router from './router'
@@ -23,6 +21,7 @@ import '@/permission' // permission control
import request from './api/request'
import i18n from './i18n'
import utils from './utils'
Vue.use(ElementUI, { locale })
@@ -45,6 +44,12 @@ window._hmt = window._hmt || [];
// inject request api
Vue.prototype.$request = request
// inject utils
Vue.prototype.$utils = utils
// inject stats
Vue.prototype.$st = utils.stats
const app = new Vue({
el: '#app',
i18n,

View File

@@ -1,6 +1,8 @@
import Vue from 'vue'
import Router from 'vue-router'
import stats from '../utils/stats'
/* Layout */
import Layout from '../views/layout/Layout'
@@ -225,7 +227,7 @@ router.beforeEach((to, from, next) => {
router.afterEach((to, from, next) => {
if (to.path) {
if (localStorage.getItem('useStats') !== '0') {
window._hmt.push(['_trackPageview', to.path])
stats.sendPv(to.path)
}
}
})

View File

@@ -0,0 +1,5 @@
import stats from './stats'
export default {
stats
}

View File

@@ -0,0 +1,8 @@
export default {
sendPv (page) {
window._hmt.push(['_trackPageview', page])
},
sendEv (ev) {
window._hmt.push(['_trackCustomEvent', ev])
}
}