10 lines
284 B
TypeScript
10 lines
284 B
TypeScript
import type { App } from "vue";
|
|
import { createPinia } from "pinia";
|
|
import { createPersistedState } from "pinia-plugin-persistedstate"; // 数据持久化
|
|
|
|
export function setupPinia(app: App) {
|
|
const store = createPinia();
|
|
store.use(createPersistedState());
|
|
app.use(store);
|
|
}
|