vue-annotator icon indicating copy to clipboard operation
vue-annotator copied to clipboard

[Props]: Add mock-draw

Open DrSensor opened this issue 7 years ago • 0 comments

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>

DrSensor avatar Apr 11 '18 00:04 DrSensor