chore: use enum in Marker.vue

This commit is contained in:
braks
2022-10-07 22:55:38 +02:00
committed by Braks
parent 00059aabab
commit a840a5cf58
@@ -1,4 +1,5 @@
<script lang="ts" setup> <script lang="ts" setup>
import { MarkerType } from '../../types/edge'
import type { MarkerProps } from '../../types/edge' import type { MarkerProps } from '../../types/edge'
const { const {
@@ -7,7 +8,7 @@ const {
width = 12.5, width = 12.5,
height = 12.5, height = 12.5,
markerUnits = 'strokeWidth', markerUnits = 'strokeWidth',
orient = 'auto', orient = 'auto-start-reverse',
strokeWidth = 1, strokeWidth = 1,
color = 'none', color = 'none',
} = defineProps<MarkerProps>() } = defineProps<MarkerProps>()
@@ -32,7 +33,7 @@ export default {
:orient="orient" :orient="orient"
> >
<polyline <polyline
v-if="type === 'arrowclosed'" v-if="type === MarkerType.ArrowClosed"
:stroke="color" :stroke="color"
stroke-linecap="round" stroke-linecap="round"
stroke-linejoin="round" stroke-linejoin="round"
@@ -41,7 +42,7 @@ export default {
points="-5,-4 0,0 -5,4 -5,-4" points="-5,-4 0,0 -5,4 -5,-4"
/> />
<polyline <polyline
v-if="type === 'arrow'" v-if="type === MarkerType.Arrow"
:stroke="color" :stroke="color"
stroke-linecap="round" stroke-linecap="round"
stroke-linejoin="round" stroke-linejoin="round"