File tree Expand file tree Collapse file tree 2 files changed +56
-1
lines changed Expand file tree Collapse file tree 2 files changed +56
-1
lines changed Original file line number Diff line number Diff line change
1
+ <!--
2
+
3
+ Simple Arrow
4
+
5
+ <arrow x1="10" y1="20" x2="100" y2="200" color="green" width="3" />
6
+
7
+ <arrow v-bind="{ x1:10, y1:10, x2:200, y2:200 }"/>
8
+
9
+ -->
10
+
11
+ <script setup lang="ts">
12
+ import { defineProps } from ' vue'
13
+
14
+ defineProps <{
15
+ x1: number | string
16
+ y1: number | string
17
+ x2: number | string
18
+ y2: number | string
19
+ width? : number | string
20
+ color? : string
21
+ }>()
22
+ </script >
23
+
24
+ <template >
25
+ <svg
26
+ class =" absolute left-0 top-0 pointer-events-none"
27
+ :width =" Math.max(+x1, +x2) + 50"
28
+ :height =" Math.max(+y1, +y2) + 50"
29
+ >
30
+ <defs >
31
+ <marker
32
+ id =" arrowhead"
33
+ markerUnits =" strokeWidth"
34
+ :markerWidth =" 10"
35
+ :markerHeight =" 7"
36
+ refX =" 9"
37
+ refY =" 3.5"
38
+ orient =" auto"
39
+ >
40
+ <polygon points =" 0 0, 10 3.5, 0 7" :fill =" color || 'currentColor'" />
41
+ </marker >
42
+ </defs >
43
+ <line
44
+ :x1 =" +x1"
45
+ :y1 =" +y1"
46
+ :x2 =" +x2"
47
+ :y2 =" +y2"
48
+ :stroke =" color || 'currentColor'"
49
+ :stroke-width =" width || 2"
50
+ marker-end =" url(#arrowhead)"
51
+ />
52
+ </svg >
53
+ </template >
Original file line number Diff line number Diff line change @@ -110,13 +110,15 @@ interface User {
110
110
role: string
111
111
}
112
112
113
- function updateUser(id : number , update : Partial < User > ) {
113
+ function updateUser(id : number , update : User ) {
114
114
const user = getUser (id )
115
115
const newUser = {... user , ... update }
116
116
saveUser (id , newUser )
117
117
}
118
118
```
119
119
120
+ <arrow v-click =" 3 " x1 =" 400 " y1 =" 420 " x2 =" 230 " y2 =" 330 " color =" #564 " width =" 3 " arrowSize =" 1 " />
121
+
120
122
---
121
123
122
124
# Components
You can’t perform that action at this time.
0 commit comments