feat: add pinnedFlowchart Pinia store
This commit is contained in:
1 parent
46c3176cd2
commit
ad18800ca6
1 file changed
+18
@@ -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