init
This commit is contained in:
+62
@@ -0,0 +1,62 @@
|
||||
import Vue from "vue";
|
||||
import App from "./App.vue";
|
||||
import router from "./router";
|
||||
|
||||
import api from "./api/index.js";
|
||||
// 将API方法绑定到全局
|
||||
Vue.prototype.$api = api;
|
||||
|
||||
import "@babel/polyfill";
|
||||
// import "babel-polyfill";
|
||||
|
||||
// 引用工具文件
|
||||
import utils from "./utils/index.js";
|
||||
// 将工具方法绑定到全局
|
||||
Vue.prototype.$utils = utils;
|
||||
|
||||
import APIConfig from "./config/apiConf.js";
|
||||
window.APIConfig = APIConfig;
|
||||
|
||||
import "view-design/dist/styles/iview.css";
|
||||
import ViewUI from "view-design";
|
||||
Vue.use(ViewUI);
|
||||
|
||||
import conf from "./config/hostConf.js";
|
||||
Vue.prototype.$conf = conf;
|
||||
window.conf = conf;
|
||||
|
||||
import "./assets/styles/main.scss";
|
||||
|
||||
// 是否是IE内核
|
||||
//代码高亮文件引入(IE暂不支持)
|
||||
import hljs from "highlight.js";
|
||||
//样式文件,这里我选的是sublime样式,文件里面还有其他样式可供选择
|
||||
// import "highlight.js/styles/monokai-sublime.css";
|
||||
// import "highlight.js/styles/vs2015.css";
|
||||
import "highlight.js/styles/atelier-dune-light.css";
|
||||
|
||||
Vue.directive("highlight", function(el) {
|
||||
let blocks = el.querySelectorAll("pre code");
|
||||
blocks.forEach(block => {
|
||||
hljs.highlightBlock(block);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
import codeModal from "./mixins/code_modal";
|
||||
Vue.mixin(codeModal);
|
||||
|
||||
var EventBus = new Vue(); //事件总线
|
||||
Object.defineProperties(Vue.prototype, {
|
||||
$bus: {
|
||||
get: function() {
|
||||
return EventBus;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Vue.config.productionTip = false;
|
||||
new Vue({
|
||||
router,
|
||||
render: h => h(App)
|
||||
}).$mount("#app");
|
||||
Reference in New Issue
Block a user