28 lines
477 B
TypeScript
28 lines
477 B
TypeScript
import { defineStore } from "pinia";
|
|
|
|
export const useCoopBuilderStore = defineStore(
|
|
"coop-builder",
|
|
() => {
|
|
const currentStep = ref(1);
|
|
|
|
function setStep(step: number) {
|
|
currentStep.value = Math.min(Math.max(1, step), 5);
|
|
}
|
|
|
|
function reset() {
|
|
currentStep.value = 1;
|
|
}
|
|
|
|
return {
|
|
currentStep,
|
|
setStep,
|
|
reset,
|
|
};
|
|
},
|
|
{
|
|
persist: {
|
|
key: "urgent-tools-wizard",
|
|
paths: ["currentStep"],
|
|
},
|
|
}
|
|
);
|