main.js 817 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import Vue from 'vue'
  2. import App from './App'
  3. import * as filters from './common/filters.js' // global filters
  4. import urls from './common/config.js'
  5. import utils from './common/utils.js'
  6. // 注册
  7. const toReg =()=>{
  8. uni.redirectTo({
  9. url: '/pages/login/reg'
  10. });
  11. }
  12. // 登录
  13. const toLogin =()=>{
  14. uni.redirectTo({
  15. url: '/pages/login/login'
  16. });
  17. }
  18. // 找回密码
  19. const toForgot =()=>{
  20. uni.redirectTo({
  21. url: '/pages/login/forgot'
  22. });
  23. }
  24. // 公共跳转
  25. Vue.prototype.$navs={toReg, toLogin, toForgot};
  26. // 通用工具类
  27. Vue.prototype.$utils = utils
  28. // 注册全局过滤器
  29. Object.keys(filters).forEach(key => {
  30. Vue.filter(key, filters[key])
  31. })
  32. // 地址配置
  33. Vue.prototype.$urls = urls
  34. Vue.config.productionTip = false
  35. App.mpType = 'app'
  36. const app = new Vue({
  37. ...App
  38. })
  39. app.$mount()