main.js 781 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import App from './App'
  2. import 'vant/lib/index.css';
  3. // #ifndef VUE3
  4. import Vue from 'vue'
  5. import './uni.promisify.adaptor'
  6. Vue.config.productionTip = false
  7. App.mpType = 'app'
  8. const app = new Vue({
  9. ...App
  10. })
  11. app.$mount()
  12. // #endif
  13. // #ifdef VUE3
  14. import { createSSRApp } from 'vue'
  15. import {
  16. Skeleton,
  17. SkeletonTitle,
  18. SkeletonImage,
  19. SkeletonAvatar,
  20. SkeletonParagraph,
  21. } from 'vant';
  22. import { createPinia } from 'pinia';
  23. export function createApp() {
  24. const app = createSSRApp(App);
  25. // 实例化Pinia
  26. const pinia = createPinia()
  27. // 传递给项目应用
  28. app.use(pinia)
  29. // 使用 Vant 组件
  30. app.use(Skeleton);
  31. app.use(SkeletonTitle);
  32. app.use(SkeletonImage);
  33. app.use(SkeletonAvatar);
  34. app.use(SkeletonParagraph);
  35. return {
  36. app
  37. }
  38. }
  39. // #endif