|
@@ -52,7 +52,11 @@ watch(
|
|
|
() => route.params.id as string,
|
|
|
(newId, oldId) => {
|
|
|
if (newId !== oldId) {
|
|
|
- FlowGraph.initGraphShape(flowData.value[newId]['cells'] || {})
|
|
|
+ if (flowData.value[newId]) {
|
|
|
+ FlowGraph.initGraphShape(flowData.value[newId]['cells'] || {})
|
|
|
+ } else {
|
|
|
+ FlowGraph.initGraphShape({})
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
)
|
|
@@ -104,8 +108,11 @@ const initGraph = () => {
|
|
|
}
|
|
|
handleContextmenu(e, cell)
|
|
|
})
|
|
|
-
|
|
|
- FlowGraph.initGraphShape(flowData.value[id]['cells'] || {})
|
|
|
+ if (flowData.value[id]) {
|
|
|
+ FlowGraph.initGraphShape(flowData.value[id]['cells'] || {})
|
|
|
+ } else {
|
|
|
+ FlowGraph.initGraphShape({})
|
|
|
+ }
|
|
|
isReady.value = true
|
|
|
const resizeFn = () => {
|
|
|
const { width, height } = getContainerSize($('.panel'))
|