时空网前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.1 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. import Vue from 'vue'
  2. import App from './App'
  3. import mixin from '@/common/mixin.js';
  4. import * as API from '@/common/api.js';
  5. import * as $shared from '@/common/shared.js';
  6. import { uploadFile } from '@/common/uploadFile.js'
  7. Vue.config.productionTip = false
  8. App.mpType = 'app'
  9. Vue.mixin(mixin);
  10. // 将API注入全局
  11. Vue.prototype.API = API;
  12. // 全局共享方法
  13. Vue.prototype.$shared = $shared;
  14. Vue.prototype.uploadFile = uploadFile
  15. // 引入全局uView
  16. import uView from 'uview-ui'
  17. Vue.use(uView);
  18. import { $http } from '@/common/http.js';
  19. Vue.prototype.$http = $http;
  20. //骨架屏
  21. import Skeleton from './components/my-uni-skeleton/index.vue'
  22. Vue.component('skeleton', Skeleton);
  23. // 无数据
  24. import myNocontent from './components/my-nocontent/my-nocontent.vue';
  25. Vue.component('my-nocontent', myNocontent);
  26. Vue.prototype.$toast=msg=>{
  27. uni.showToast({
  28. icon:'none',
  29. title:msg
  30. })
  31. }
  32. //路由跳转
  33. Vue.prototype.$routerGo = (obj) => {
  34. uni.navigateTo({
  35. url: obj
  36. })
  37. }
  38. const app = new Vue({
  39. ...App
  40. })
  41. // 引入http拦截器
  42. import httpInterceptor from '@/common/http.interceptor.js'
  43. Vue.use(httpInterceptor, app);
  44. app.$mount();