时空网前端
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.

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