File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,9 @@ Simple Arrow
10
10
11
11
<script setup lang="ts">
12
12
import { defineProps } from ' vue'
13
+ import { customAlphabet } from ' nanoid'
14
+
15
+ const nanoid = customAlphabet (' abcedfghicklmn' , 10 )
13
16
14
17
defineProps <{
15
18
x1: number | string
@@ -19,6 +22,8 @@ defineProps<{
19
22
width? : number | string
20
23
color? : string
21
24
}>()
25
+
26
+ const id = nanoid ()
22
27
</script >
23
28
24
29
<template >
@@ -29,7 +34,7 @@ defineProps<{
29
34
>
30
35
<defs >
31
36
<marker
32
- id =" arrowhead "
37
+ : id =" id "
33
38
markerUnits =" strokeWidth"
34
39
:markerWidth =" 10"
35
40
:markerHeight =" 7"
@@ -47,7 +52,7 @@ defineProps<{
47
52
:y2 =" +y2"
48
53
:stroke =" color || 'currentColor'"
49
54
:stroke-width =" width || 2"
50
- marker-end =" url(#arrowhead) "
55
+ : marker-end =" ` url(#${id})` "
51
56
/>
52
57
</svg >
53
58
</template >
You can’t perform that action at this time.
0 commit comments