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.

40 lines
782 B

4 weeks ago
  1. import App from './App'
  2. import pinia from './stores/index.js'
  3. // #ifndef VUE3
  4. import Vue from 'vue'
  5. import './uni.promisify.adaptor'
  6. // 导入需要全局注册的组件
  7. import LoginPrompt from './components/login-prompt.vue'
  8. // 全局注册组件
  9. Vue.component('LoginPrompt', LoginPrompt)
  10. Vue.config.productionTip = false
  11. App.mpType = 'app'
  12. const app = new Vue({
  13. ...App,
  14. // 挂载 store
  15. pinia
  16. })
  17. app.$mount()
  18. // #endif
  19. // #ifdef VUE3
  20. import { createSSRApp } from 'vue'
  21. // 导入需要全局注册的组件
  22. import LoginPrompt from './components/login-prompt.vue'
  23. export function createApp() {
  24. const app = createSSRApp(App)
  25. // 全局注册组件
  26. app.component('LoginPrompt', LoginPrompt)
  27. // 挂载 store
  28. app.use(pinia)
  29. return {
  30. app
  31. }
  32. }
  33. // #endif