Store shallowRef of litegraph canvas (#722)

* Store shallowRef of litegraph canvas

* nit
This commit is contained in:
Chenlei Hu
2024-09-03 10:11:31 -04:00
committed by GitHub
parent b49b19c9b0
commit 974a7ef63f
2 changed files with 34 additions and 32 deletions

View File

@@ -1,11 +1,19 @@
import { LGraphNode, LGraphGroup } from '@comfyorg/litegraph'
import { LGraphNode, LGraphGroup, LGraphCanvas } from '@comfyorg/litegraph'
import { defineStore } from 'pinia'
import { ref } from 'vue'
import { shallowRef } from 'vue'
export const useTitleEditorStore = defineStore('titleEditor', () => {
const titleEditorTarget = ref<LGraphNode | LGraphGroup | null>(null)
const titleEditorTarget = shallowRef<LGraphNode | LGraphGroup | null>(null)
return {
titleEditorTarget
}
})
export const useCanvasStore = defineStore('canvas', () => {
const canvas = shallowRef<LGraphCanvas | null>(null)
return {
canvas
}
})