Skip to content

Commit f192918

Browse files
committed
fix: arrow head, close #122
1 parent 203e207 commit f192918

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

packages/client/builtin/Arrow.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ Simple Arrow
1010

1111
<script setup lang="ts">
1212
import { defineProps } from 'vue'
13+
import { customAlphabet } from 'nanoid'
14+
15+
const nanoid = customAlphabet('abcedfghicklmn', 10)
1316
1417
defineProps<{
1518
x1: number | string
@@ -19,6 +22,8 @@ defineProps<{
1922
width?: number | string
2023
color?: string
2124
}>()
25+
26+
const id = nanoid()
2227
</script>
2328

2429
<template>
@@ -29,7 +34,7 @@ defineProps<{
2934
>
3035
<defs>
3136
<marker
32-
id="arrowhead"
37+
:id="id"
3338
markerUnits="strokeWidth"
3439
:markerWidth="10"
3540
:markerHeight="7"
@@ -47,7 +52,7 @@ defineProps<{
4752
:y2="+y2"
4853
:stroke="color || 'currentColor'"
4954
:stroke-width="width || 2"
50-
marker-end="url(#arrowhead)"
55+
:marker-end="`url(#${id})`"
5156
/>
5257
</svg>
5358
</template>

0 commit comments

Comments
 (0)