update
This commit is contained in:
18
src/shared/store/myFlowchart.ts
Normal file
18
src/shared/store/myFlowchart.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { defineStore } from "pinia"
|
||||
|
||||
export const useMyFlowchartStore = defineStore("myFlowchart", () => {
|
||||
const showing = ref(false)
|
||||
const mermaidCode = ref("")
|
||||
|
||||
function show(code: string) {
|
||||
mermaidCode.value = code
|
||||
showing.value = true
|
||||
}
|
||||
|
||||
function hide() {
|
||||
showing.value = false
|
||||
mermaidCode.value = ""
|
||||
}
|
||||
|
||||
return { showing, mermaidCode, show, hide }
|
||||
})
|
||||
@@ -1,18 +0,0 @@
|
||||
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