main.js 797 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import App from './App'
  2. import Vue from 'vue'
  3. import store from './store'
  4. import uvUI from '@/uni_modules/uv-ui-tools'
  5. Vue.use(uvUI);
  6. uni.$uv.setConfig({
  7. // 修改$uv.config对象的属性
  8. config: {
  9. // 修改默认单位为rpx,相当于执行 uni.$uv.config.unit = 'rpx'
  10. unit: 'rpx'
  11. }
  12. })
  13. Vue.prototype.$store = store;
  14. import chat from './uitls/chat.js'
  15. chat.init();
  16. Vue.prototype.$chat = chat;
  17. Vue.prototype.$toast = msg => {
  18. uni.showToast({
  19. title: msg,
  20. icon: "none"
  21. })
  22. };
  23. Vue.prototype.$navigateTo = (url) => {
  24. if (!uni.getStorageSync('token') && url != '/pages/login/login') {
  25. url = '/pages/login/login';
  26. }
  27. uni.navigateTo({
  28. url: url
  29. })
  30. }
  31. Vue.config.productionTip = false;
  32. App.mpType = 'app'
  33. const app = new Vue({
  34. ...App
  35. })
  36. app.$mount()