refactor(vue-flow,nodes): remove v-model

This commit is contained in:
Braks
2022-05-27 23:36:01 +02:00
parent ddac5b0e58
commit c059b5929a
2 changed files with 2 additions and 6 deletions
@@ -6,7 +6,6 @@ import { getConnectedEdges, getHandleBounds, getXYZPos } from '../../utils'
const { id, type, name, draggable, selectable, connectable, snapGrid, ...props } = defineProps<{
id: string
modelValue: XYZPosition
draggable: boolean
selectable: boolean
connectable: boolean
@@ -17,8 +16,6 @@ const { id, type, name, draggable, selectable, connectable, snapGrid, ...props }
const emit = defineEmits(['update:modelValue'])
let computedPosition = $(useVModel(props, 'modelValue', emit))
provide(NodeId, id)
const {
@@ -117,9 +114,9 @@ onMounted(() => {
}
if (parentX && parentY) {
computedPosition = getXYZPos({ x: parentX, y: parentY, z: parentZ! }, xyzPos)
node.computedPosition = getXYZPos({ x: parentX, y: parentY, z: parentZ! }, xyzPos)
} else {
computedPosition = xyzPos
node.computedPosition = xyzPos
}
node.handleBounds = getHandleBounds(nodeElement.value, viewport.zoom)
@@ -60,7 +60,6 @@ export default {
v-for="node of getNodes"
:id="node.id"
:key="node.id"
v-model="node.computedPosition"
:type="getType(node.type, node.template)"
:name="node.type || 'default'"
:draggable="draggable(node.draggable)"