update(examples): move examples into src dir

This commit is contained in:
Braks
2022-04-04 21:42:48 +02:00
parent 9539d7f263
commit c1594b0071
53 changed files with 34 additions and 35 deletions
@@ -0,0 +1,21 @@
<script lang="ts" setup>
interface CustomConnectionLineProps {
sourceX: number
sourceY: number
targetX: number
targetY: number
}
const props = defineProps<CustomConnectionLineProps>()
</script>
<template>
<g>
<path
class="animated"
fill="none"
stroke="#222"
:stroke-width="1.5"
:d="`M${props.sourceX},${props.sourceY} C ${props.sourceX} ${props.targetY} ${props.sourceX} ${props.targetY} ${props.targetX},${props.targetY}`"
/>
<circle :cx="props.targetX" :cy="props.targetY" fill="#fff" :r="3" stroke="#222" :stroke-width="1.5" />
</g>
</template>
@@ -0,0 +1,21 @@
<script lang="ts" setup>
import ConnectionLine from './ConnectionLine.vue'
import { VueFlow, Background, BackgroundVariant, Elements } from '@braks/vue-flow'
const elements = ref<Elements>([
{
id: '1',
type: 'input',
label: 'Node 1',
position: { x: 250, y: 5 },
},
])
</script>
<template>
<VueFlow v-model="elements">
<template #connection-line="props">
<ConnectionLine v-bind="props" />
</template>
<Background :variant="BackgroundVariant.Lines" />
</VueFlow>
</template>