Skip to content
This repository has been archived by the owner on Feb 14, 2023. It is now read-only.

[Props]: Add mock-draw #17

Open
DrSensor opened this issue Apr 11, 2018 · 0 comments
Open

[Props]: Add mock-draw #17

DrSensor opened this issue Apr 11, 2018 · 0 comments

Comments

@DrSensor
Copy link
Owner

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>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant