fix: node type change not triggering recalculation of node dimensions

This commit is contained in:
Braks
2021-10-21 16:23:23 +02:00
parent 636eeff9fe
commit cd02dd0444
6 changed files with 23 additions and 7 deletions
+12
View File
@@ -1,5 +1,6 @@
<script lang="ts" setup>
import { DraggableEventListener } from '@braks/revue-draggable'
import { watchPostEffect } from 'vue'
import { Node, NodeType, SnapGrid } from '~/types'
import { NodeIdContextKey } from '~/context'
import { useHooks, useStore } from '~/composables'
@@ -122,6 +123,17 @@ onMounted(() => {
}),
)
})
watch(
() => props.node.type,
() => {
store.updateNodeDimensions({
id: props.node.id,
nodeElement: nodeElement.value,
forceUpdate: true,
})
},
)
</script>
<template>