app.js 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. function printJoinUsInfo() {
  31. var joinUsHtml = `我不知道你来自哪里?亦不知道你将去何方?
  32. 但当你打开这个页面之时,我知道,
  33. 一定是代码的缘分将你我拉近!
  34. 金鳞岂是池中物,一遇风云便化龙。
  35. 少年!我看你骨骼惊奇,一定是敲代码的奇才!
  36. 加入我们,加入JDC-前端开发部 http://fe.jd.com/ !你,必将改变亿万人民的生活!
  37. 欢迎点击 http://jdc.jd.com , 或者关注公众号“全栈探索”来了解我们,
  38. 还犹豫什么?快将简历投至: yfzhoutao@jd.com (请注明来自console)
  39. 我们在这里等你哦!`
  40. if (window.console && console.log && navigator.userAgent.toLowerCase().match(/chrome\/([\d.]+)/)) {
  41. joinUsHtml = joinUsHtml.replace(/%c/g, '');
  42. joinUsHtml = '%c' + joinUsHtml;
  43. var weightSize = 'color: #e2231a; font-family: "Microsoft Yahei"';
  44. console.log(joinUsHtml, weightSize);
  45. //var normalSize = 'color: #666; font-family: "Microsoft Yahei"';
  46. //console.log(joinUsHtml, normalSize, weightSize, normalSize, weightSize, normalSize, weightSize);
  47. }
  48. }
  49. printJoinUsInfo();
  50. try {
  51. /*初始化分享*/
  52. window.share.shareInit(shareOption);
  53. } catch (e) {
  54. console.log(e);
  55. }