import { createSSRApp } from 'vue' import { createPinia } from 'pinia'; // 引入 Pinia import App from './App.vue' // 创建 Pinia 实例 const pinia = createPinia(); export function createApp() { const app = createSSRApp(App) // 使用createSSRApp创建应用实例(对于小程序很重要) // 使用 Pinia app.use(pinia); // app.use(store) // 使用Vuex等状态管理库(如果有的话) return { app } // 注意此处返回的是app实例的引用,这对于小程序很重要。 }