app.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. import "core-js/modules/es6.promise";
  2. import "core-js/modules/es6.array.iterator";
  3. import Vue from 'vue';
  4. import App from './App.vue';
  5. import router from './router';
  6. import Conf from '../../src/config.json';
  7. import NutUI from '../../src/nutui';
  8. // import en from '../../src/locales/lang/en-US';
  9. // import demoEN from './lang/en-US';
  10. import './asset/css/common.scss';
  11. import './asset/img/logo_share.png';
  12. Vue.config.productionTip = false;
  13. // Object.assign(en, demoEN);
  14. // Vue.use(NutUI, {
  15. // locale: 'en-US',
  16. // lang: en
  17. // });
  18. NutUI.install(Vue);
  19. //Vue.locale = () => {};
  20. // const i18n = new VueI18n({
  21. // locale: 'en-US',
  22. // messages: {
  23. // 'en-US': en
  24. // }
  25. // });
  26. // 兼容vue-i18n
  27. // Vue.locale = () => {};
  28. // const i18n = new VueI18n({
  29. // locale: 'en-US',
  30. // messages: {
  31. // 'en-US': en
  32. // }
  33. // });
  34. // Vue.prototype.$i18n = i18n;
  35. // Vue.use(VueI18n);
  36. const app = new Vue({
  37. el: '#demo',
  38. router,
  39. components: { App },
  40. template: '<App/>'
  41. })
  42. Vue.prototype.NUTCONF = Conf;
  43. let pageLoading = app.$toast.loading();
  44. router.beforeEach((to, from, next) => {
  45. pageLoading.show();
  46. next();
  47. })
  48. router.beforeResolve((to, from, next) => {
  49. next();
  50. });
  51. router.afterEach((to, from) => {
  52. pageLoading.hide();
  53. });