update: pass store state as props to edge-renderer and edge
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -42,6 +42,7 @@ const center = computed(() =>
|
||||
targetY: props.targetY,
|
||||
}),
|
||||
)
|
||||
const onClick = () => console.log(props.data)
|
||||
</script>
|
||||
<script lang="ts">
|
||||
export default {
|
||||
@@ -59,6 +60,6 @@ export default {
|
||||
:label-bg-style="{ fill: 'red' }"
|
||||
:label-bg-padding="[2, 4]"
|
||||
:label-bg-border-radius="2"
|
||||
@click="() => console.log(props.data)"
|
||||
@click="onClick"
|
||||
/>
|
||||
</template>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<script lang="ts" setup>
|
||||
interface CustomLabelProps {
|
||||
text: string
|
||||
label: string
|
||||
}
|
||||
|
||||
const props = defineProps<CustomLabelProps>()
|
||||
</script>
|
||||
<template>
|
||||
<tspan dy="10" x="0">{{ props.text }}</tspan>
|
||||
<tspan dy="10" x="0">{{ props.label }}</tspan>
|
||||
</template>
|
||||
|
||||
@@ -42,7 +42,7 @@ const initialElements: Elements = [
|
||||
label: {
|
||||
component: markRaw(CustomLabel),
|
||||
props: {
|
||||
text: 'custom label text',
|
||||
label: 'custom label text',
|
||||
},
|
||||
},
|
||||
labelStyle: { fill: 'red', fontWeight: 700 },
|
||||
|
||||
Reference in New Issue
Block a user