// 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 ElementUI from 'element-ui' 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 * as echarts from 'echarts' import router from './router' Vue.config.productionTip = false Vue.prototype.$echarts = echarts Vue.use(ElementUI) 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 // 添加cookies的生命周期 console.log(Vue.prototype.$cookies) Vue.prototype.$cookies.set("user_session", "null") console.log('测试', Vue.prototype.$cookies) new Vue({ el: '#app', router, components: { App }, template: '' })