12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- import App from './App'
- import 'vant/lib/index.css';
- // #ifndef VUE3
- import Vue from 'vue'
- import './uni.promisify.adaptor'
- Vue.config.productionTip = false
- App.mpType = 'app'
- const app = new Vue({
- ...App
- })
- app.$mount()
- // #endif
- // #ifdef VUE3
- import { createSSRApp } from 'vue'
- import {
- Skeleton,
- SkeletonTitle,
- SkeletonImage,
- SkeletonAvatar,
- SkeletonParagraph,
- } from 'vant';
- import { createPinia } from 'pinia';
- export function createApp() {
- const app = createSSRApp(App);
- // 实例化Pinia
- const pinia = createPinia()
- // 传递给项目应用
- app.use(pinia)
- // 使用 Vant 组件
- app.use(Skeleton);
- app.use(SkeletonTitle);
- app.use(SkeletonImage);
- app.use(SkeletonAvatar);
- app.use(SkeletonParagraph);
-
- return {
- app
- }
- }
- // #endif
|