main.js 717 B

123456789101112131415161718192021222324252627282930313233
  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. Vue.prototype.$toast = msg => {
  15. uni.showToast({
  16. title: msg,
  17. icon: "none"
  18. })
  19. };
  20. Vue.prototype.$navigateTo = (url) => {
  21. if (!uni.getStorageSync('token') && url != '/pages/login/login') {
  22. url = '/pages/login/login';
  23. }
  24. uni.navigateTo({
  25. url: url
  26. })
  27. }
  28. Vue.config.productionTip = false;
  29. App.mpType = 'app'
  30. const app = new Vue({
  31. ...App
  32. })
  33. app.$mount()