fix(nodes,edges): Cast styles to css properties
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
import { CSSProperties } from 'vue'
|
||||||
import { useHandle, useVueFlow } from '../../composables'
|
import { useHandle, useVueFlow } from '../../composables'
|
||||||
import { ConnectionMode, EdgeComponent, GraphEdge, Position } from '../../types'
|
import { ConnectionMode, EdgeComponent, GraphEdge, Position } from '../../types'
|
||||||
import { getEdgePositions, getHandle, getMarkerId } from '../../utils'
|
import { getEdgePositions, getHandle, getMarkerId } from '../../utils'
|
||||||
@@ -161,7 +162,7 @@ const getClass = computed(() => {
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
const getStyle = () => (edge.value.style instanceof Function ? edge.value.style(edge.value) : edge.value.style)
|
const getStyle = () => (edge.value.style instanceof Function ? edge.value.style(edge.value) : edge.value.style) as CSSProperties
|
||||||
</script>
|
</script>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useDraggableCore } from '@braks/revue-draggable'
|
import { useDraggableCore } from '@braks/revue-draggable'
|
||||||
|
import { CSSProperties } from 'vue'
|
||||||
import { useVueFlow } from '../../composables'
|
import { useVueFlow } from '../../composables'
|
||||||
import { GraphNode, NodeComponent, SnapGrid } from '../../types'
|
import { GraphNode, NodeComponent, SnapGrid } from '../../types'
|
||||||
import { NodeId, Slots } from '../../context'
|
import { NodeId, Slots } from '../../context'
|
||||||
@@ -183,7 +184,7 @@ const getStyle = computed(() => {
|
|||||||
transform: `translate(${node.value.computedPosition.x}px,${node.value.computedPosition.y}px)`,
|
transform: `translate(${node.value.computedPosition.x}px,${node.value.computedPosition.y}px)`,
|
||||||
pointerEvents: props.selectable || props.draggable ? 'all' : 'none',
|
pointerEvents: props.selectable || props.draggable ? 'all' : 'none',
|
||||||
...styles,
|
...styles,
|
||||||
}
|
} as CSSProperties
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
|||||||
@@ -7111,7 +7111,7 @@ vue-tsc@^0.33.9:
|
|||||||
dependencies:
|
dependencies:
|
||||||
"@volar/vue-typescript" "0.33.9"
|
"@volar/vue-typescript" "0.33.9"
|
||||||
|
|
||||||
vue@^3.2.21, vue@^3.2.31:
|
vue@^3.2.25, vue@^3.2.31:
|
||||||
version "3.2.31"
|
version "3.2.31"
|
||||||
resolved "https://registry.yarnpkg.com/vue/-/vue-3.2.31.tgz#e0c49924335e9f188352816788a4cca10f817ce6"
|
resolved "https://registry.yarnpkg.com/vue/-/vue-3.2.31.tgz#e0c49924335e9f188352816788a4cca10f817ce6"
|
||||||
integrity sha512-odT3W2tcffTiQCy57nOT93INw1auq5lYLLYtWpPYQQYQOOdHiqFct9Xhna6GJ+pJQaF67yZABraH47oywkJgFw==
|
integrity sha512-odT3W2tcffTiQCy57nOT93INw1auq5lYLLYtWpPYQQYQOOdHiqFct9Xhna6GJ+pJQaF67yZABraH47oywkJgFw==
|
||||||
|
|||||||
Reference in New Issue
Block a user