examples: add math example (#1461)

* examples: add math example

* docs: add math example
This commit is contained in:
Braks
2024-06-08 20:35:18 +02:00
committed by GitHub
parent f74be96b2d
commit a8ba97331f
23 changed files with 748 additions and 11 deletions
+22
View File
@@ -0,0 +1,22 @@
<script setup>
import { Handle, Position, useVueFlow } from '@vue-flow/core'
const props = defineProps(['id', 'data'])
const { updateNodeData } = useVueFlow()
function onChange(event) {
const value = Number.parseFloat(event.target.value)
if (!Number.isNaN(value)) {
updateNodeData(props.id, { value })
}
}
</script>
<template>
<label :for="`${id}-input`"> </label>
<input :id="`${id}-input`" :value="data.value" type="number" class="nodrag" @change="onChange" />
<Handle type="source" :position="Position.Right" :connectable="false" />
</template>