chore(core): update functional component types

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
braks
2023-02-17 12:41:32 +01:00
committed by Braks
parent cbc29e505d
commit aafd8622f4
4 changed files with 9 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
import { isNumber } from '@vueuse/core'
import type { FunctionalComponent } from 'vue'
import type { Component, FunctionalComponent } from 'vue'
import EdgeText from './EdgeText.vue'
import type { BaseEdgeProps } from '~/types'
@@ -41,7 +41,7 @@ const BaseEdge: FunctionalComponent<BaseEdgeProps> = function (
})
: null,
label && isNumber(labelX) && isNumber(labelY)
? h(EdgeText, {
? h(EdgeText as Component, {
x: labelX,
y: labelY,
label,

View File

@@ -1,4 +1,4 @@
import type { FunctionalComponent } from 'vue'
import type { Component, FunctionalComponent } from 'vue'
import Handle from '../Handle/Handle.vue'
import type { NodeProps } from '~/types'
import { Position } from '~/types'
@@ -12,9 +12,9 @@ const DefaultNode: FunctionalComponent<NodeProps> = function ({
isValidSourcePos,
}) {
return [
h(Handle, { type: 'target', position: targetPosition, connectable, isValidConnection: isValidTargetPos }),
h(Handle as Component, { type: 'target', position: targetPosition, connectable, isValidConnection: isValidTargetPos }),
typeof label !== 'string' && label ? h(label) : h('div', { innerHTML: label }),
h(Handle, { type: 'source', position: sourcePosition, connectable, isValidConnection: isValidSourcePos }),
h(Handle as Component, { type: 'source', position: sourcePosition, connectable, isValidConnection: isValidSourcePos }),
]
}

View File

@@ -1,4 +1,4 @@
import type { FunctionalComponent } from 'vue'
import type { Component, FunctionalComponent } from 'vue'
import Handle from '../Handle/Handle.vue'
import type { NodeProps } from '~/types'
import { Position } from '~/types'
@@ -11,7 +11,7 @@ const InputNode: FunctionalComponent<NodeProps> = function ({
}) {
return [
typeof label !== 'string' && label ? h(label) : h('div', { innerHTML: label }),
h(Handle, { type: 'source', position: sourcePosition, connectable, isValidConnection: isValidSourcePos }),
h(Handle as Component, { type: 'source', position: sourcePosition, connectable, isValidConnection: isValidSourcePos }),
]
}

View File

@@ -1,4 +1,4 @@
import type { FunctionalComponent } from 'vue'
import type { Component, FunctionalComponent } from 'vue'
import Handle from '../Handle/Handle.vue'
import type { NodeProps } from '~/types'
import { Position } from '~/types'
@@ -10,7 +10,7 @@ const OutputNode: FunctionalComponent<NodeProps> = function ({
isValidTargetPos,
}) {
return [
h(Handle, { type: 'target', position: targetPosition, connectable, isValidConnection: isValidTargetPos }),
h(Handle as Component, { type: 'target', position: targetPosition, connectable, isValidConnection: isValidTargetPos }),
typeof label !== 'string' && label ? h(label) : h('div', { innerHTML: label }),
]
}