main.js 641 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import App from './App'
  2. // #ifndef VUE3
  3. import Vue from 'vue'
  4. import './uni.promisify.adaptor'
  5. Vue.config.productionTip = false
  6. App.mpType = 'app'
  7. const app = new Vue({
  8. ...App
  9. })
  10. app.$mount()
  11. // #endif
  12. // #ifdef VUE3
  13. // 引入uview UI
  14. import uView from './uni_modules/vk-uview-ui'
  15. import {
  16. createPinia
  17. } from 'pinia'
  18. import {
  19. createSSRApp
  20. } from 'vue'
  21. import {
  22. useAuthStore
  23. } from '@/store/authStore'
  24. export function createApp() {
  25. const app = createSSRApp(App)
  26. const pinia = createPinia()
  27. // 使用uView UI
  28. app.use(uView)
  29. app.use(pinia)
  30. const authStore = useAuthStore();
  31. authStore.loadAuthToken();
  32. return {
  33. app
  34. }
  35. }
  36. // #endif