main.js 653 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. export function createApp() {
  23. const app = createSSRApp(App);
  24. // 使用 Vant 组件
  25. app.use(Skeleton);
  26. app.use(SkeletonTitle);
  27. app.use(SkeletonImage);
  28. app.use(SkeletonAvatar);
  29. app.use(SkeletonParagraph);
  30. return {
  31. app
  32. }
  33. }
  34. // #endif