TakeOutShop/main.js
2025-04-01 12:05:30 +08:00

12 lines
506 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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实例的引用这对于小程序很重要。
}