TakeOutShop/main.js
2025-03-04 23:07:40 +08:00

14 lines
614 B
JavaScript
Raw 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 store from './store' // 如果使用Vuex等状态管理库则需要引入store等配置项。
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实例的引用这对于小程序很重要。
}