Files
vue-flow/src/components/Nodes/InputNode.vue
T
Braks 10215b4631 update: create vue.d.ts files
* add vue-tsc to emit d.ts files from vue components
* use absolute paths in components
* avoids conflicts with ts custom paths in vue-tsc generated vue.d.ts files

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-17 01:39:50 +01:00

27 lines
751 B
Vue

<script lang="ts" setup>
import Handle from '../Handle/Handle.vue'
import { NodeProps, Position } from '../../types'
interface InputNodeProps extends NodeProps {
data?: NodeProps['data']
connectable?: NodeProps['connectable']
sourcePosition?: NodeProps['sourcePosition']
}
const props = withDefaults(defineProps<InputNodeProps>(), {
data: () => {},
connectable: false,
sourcePosition: Position.Bottom,
})
</script>
<script lang="ts">
export default {
inheritAttrs: false,
}
</script>
<template>
<component :is="props.data?.label" v-if="typeof props.data?.label !== 'string'" />
<span v-else v-html="props.data?.label"></span>
<Handle type="source" :position="props.sourcePosition" :connectable="props.connectable" />
</template>