app.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import 'babel-polyfill';
  2. import Vue from 'vue';
  3. import App from './app.vue';
  4. import router from './router.js';
  5. import NutUI from './nutui.js';
  6. import codeBox from './package/codebox/index.js';
  7. import docHeader from './package/docheader/index.js';
  8. import VueQriously from 'vue-qriously';
  9. import Conf from '../config.json';
  10. import share from './asset/js/share.min.js';
  11. Vue.prototype.NUTCONF = Conf;
  12. NutUI.install(Vue);
  13. //二维码生成
  14. Vue.use(VueQriously);
  15. Vue.component('nut-codebox', codeBox);
  16. Vue.component('nut-docheader', docHeader);
  17. Vue.directive('highlight',function (el) {
  18. hljs.highlightBlock(el)
  19. });
  20. const app = new Vue({
  21. router,
  22. render: h => h(App),
  23. }).$mount('#app');
  24. var shareOption = {
  25. iconUrl: 'http://nutui.jd.com/asset/img/share.png',
  26. url: location.href,
  27. title: "NutUI - 基于Vue2.0的移动端开源组件库",
  28. desc: '一套拥有电商基因的基于Vue2.0的轻量级移动端开源组件库'
  29. };
  30. try {
  31. /*初始化分享*/
  32. window.share.shareInit(shareOption);
  33. } catch (e) {
  34. console.log(e);
  35. }