xyyd-fatfox/src/widgets/work/useTomatoStore.ts

30 lines
635 B
TypeScript
Raw Normal View History

2024-11-01 18:36:07 +08:00
import { defineStore } from "pinia";
import { reactive, ref } from "vue";
export type TomatoTarget = {
id: string;
finishTime: number;
remindTime: number | null;
title: string;
2024-11-03 22:34:59 +08:00
isCompleted: boolean;
2024-11-01 18:36:07 +08:00
}
2024-11-03 22:34:59 +08:00
export type TomatoTime = {
date: number;
finishTime: number;
}
2024-11-01 18:36:07 +08:00
export default defineStore("work", () => {
const state = reactive({
list: [] as TomatoTarget[],
2024-11-03 22:34:59 +08:00
timeList: [] as TomatoTime[]
2024-11-01 18:36:07 +08:00
})
const openShowModel = ref<undefined | null | TomatoTarget>()
2024-11-03 23:54:21 +08:00
const openFullscreen = ref(false)
2024-11-01 18:36:07 +08:00
return {
state,
2024-11-03 23:54:21 +08:00
openShowModel,
openFullscreen
2024-11-01 18:36:07 +08:00
}
})