fix pinia store
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { pinia } from "@/store/store";
|
||||
import { defineApp } from "iles";
|
||||
import { createPinia } from "pinia";
|
||||
|
||||
export default defineApp({
|
||||
enhanceApp({ app }) {
|
||||
app.use(createPinia());
|
||||
app.use(pinia);
|
||||
},
|
||||
});
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { pinia } from "@/store/store";
|
||||
import { defineStore } from "pinia";
|
||||
|
||||
interface Step {
|
||||
@@ -20,7 +21,7 @@ const initialState: State = {
|
||||
],
|
||||
};
|
||||
|
||||
export const useProductionFlow = defineStore("production-flow", {
|
||||
const useStore = defineStore("production-flow", {
|
||||
state: () => ({ ...initialState }),
|
||||
actions: {
|
||||
addStep(step: Step) {
|
||||
@@ -28,3 +29,5 @@ export const useProductionFlow = defineStore("production-flow", {
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export const useProductionFlow = () => useStore(pinia);
|
||||
|
||||
3
src/store/store.ts
Normal file
3
src/store/store.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import { createPinia } from "pinia";
|
||||
|
||||
export const pinia = createPinia();
|
||||
Reference in New Issue
Block a user