vue-annotator
vue-annotator copied to clipboard
[Props]: Add mock-draw
Similiar to draw prop but it only mock (only do the drawing animation), doesn't create the annotation. (doesn't clone-append to <g>...</g> when @drawFinish)
Useful if you want to control how the annotation is created.
In my case the creation depends on query result from ApolloQuery component)
Usage
<v-annotator mock-draw>
<template v-for="({x, y, w, h, shape}, index) in onQueryUpdate(dataFromSlotScope)">
<rect v-if="shape === 'rect'" :x="x" :y="y" :width="w" :height="h" :key="index" />
<circle v-else-if="shape === 'circle'" :cx="x" :cy="y" :r="(w+h)/2" :key="index" />
</template>
<rect slot="drawing" />
</v-annotator>