xm-select/docs/entry.js

47 lines
1.0 KiB
JavaScript
Raw Normal View History

2019-11-07 10:52:51 +08:00
import "babel-polyfill"
2019-09-25 17:47:38 +08:00
import Vue from 'vue';
import ElementUI from 'element-ui';
2019-11-25 15:17:08 +08:00
import 'element-ui/lib/theme-chalk/index.css';
2019-09-25 17:47:38 +08:00
import hljs from 'highlight.js';
2019-11-25 15:17:08 +08:00
// import 'highlight.js/styles/color-brewer.css'
import 'highlight.js/styles/monokai-sublime.css'
2019-09-25 17:47:38 +08:00
import VueRouter from 'vue-router';
import routes from './router';
import App from './App.vue';
import demoBlock from './components/demo-block.vue';
// import './plugins'
2019-09-25 17:47:38 +08:00
Vue.use(ElementUI);
Vue.use(VueRouter);
Vue.component('demo-block', demoBlock);
import './assets/common.less'
const router = new VueRouter({
mode: 'hash',
base: __dirname,
routes
});
2019-11-11 11:54:51 +08:00
router.beforeEach((to, from, next) => {
if (to.path) {
2019-11-20 18:47:49 +08:00
_hmt.push(['_trackPageview', '/xm-select/#' + to.fullPath]);
2019-11-11 11:54:51 +08:00
}
next();
});
2019-09-25 17:47:38 +08:00
router.afterEach(route => {
Vue.nextTick(() => {
const blocks = document.querySelectorAll('pre code:not(.hljs)');
Array.prototype.forEach.call(blocks, hljs.highlightBlock);
});
});
new Vue({
el: '#app',
router,
render: h => h(App)
});