From ad18800ca60c4949267e1fb4fbc27672d5244790 Mon Sep 17 00:00:00 2001 From: yuetsh <517252939@qq.com> Date: Mon, 25 May 2026 00:01:50 -0600 Subject: [PATCH] feat: add pinnedFlowchart Pinia store --- src/shared/store/pinnedFlowchart.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/shared/store/pinnedFlowchart.ts diff --git a/src/shared/store/pinnedFlowchart.ts b/src/shared/store/pinnedFlowchart.ts new file mode 100644 index 0000000..aa32086 --- /dev/null +++ b/src/shared/store/pinnedFlowchart.ts @@ -0,0 +1,18 @@ +import { defineStore } from "pinia" + +export const usePinnedFlowchartStore = defineStore("pinnedFlowchart", () => { + const isPinned = ref(false) + const mermaidCode = ref("") + + function pin(code: string) { + mermaidCode.value = code + isPinned.value = true + } + + function unpin() { + isPinned.value = false + mermaidCode.value = "" + } + + return { isPinned, mermaidCode, pin, unpin } +})