feat: add pinnedFlowchart Pinia store
This commit is contained in:
18
src/shared/store/pinnedFlowchart.ts
Normal file
18
src/shared/store/pinnedFlowchart.ts
Normal file
@@ -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 }
|
||||
})
|
||||
Reference in New Issue
Block a user