main.js 1.1 KB
Newer Older
yma16's avatar
yma16 已提交
1 2 3 4 5 6 7 8 9 10 11
// 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 './plugins/axios'
import App from './App'
import 'element-ui/lib/theme-chalk/index.css'
import cookies from 'vue-cookies'
import 'github-markdown-css/github-markdown.css'
import hljs from 'highlight.js'
import 'highlight.js/styles/github.css'
import router from './router'
yma16's avatar
yma16 已提交
12 13 14 15 16 17 18 19 20
import importElementComponents from './importElement'

import importEchartsComponents from './importEchartsComponents'

// 按需引入elementui
importElementComponents()

//按需引入echarts
importEchartsComponents()
yma16's avatar
yma16 已提交
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35

Vue.config.productionTip = false
Vue.use(cookies)

// Vue.use(hljs)
Vue.directive('highlight', function(el) {
    const blocks = el.querySelectorAll('pre code')
    blocks.forEach(block => {
        hljs.highlightBlock(block)
    })
})

// Vue.prototype.http = axios;
Vue.prototype.$cookies = cookies

yma16's avatar
yma16 已提交
36
Vue.prototype.$cookies.set("user_session", "null")
yma16's avatar
yma16 已提交
37 38 39 40 41 42

new Vue({
    el: '#app',
    router,
    components: { App },
    template: '<App/>'
yma16's avatar
yma16 已提交
43
})