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

run event select after event @draw-end="createRect" #25

Open
patrykKlimczak opened this issue Feb 10, 2020 · 3 comments
Open

run event select after event @draw-end="createRect" #25

patrykKlimczak opened this issue Feb 10, 2020 · 3 comments

Comments

@patrykKlimczak
Copy link

Hi, I have problem with run methods after methods

createRect() {
      const canvas = this.$refs.canvas;
      const eIsSameNode = e.node.isSameNode(canvas);
      this.$refs.canvas._events.select(eIsSameNode);
}

Now:
image

I need to create new rect element and just now select this:

image

@DrSensor
Copy link
Owner

Could you tell me:

  • the web browser you use along with its version number
  • the exact Vue version
  • the exact version number of the dependencies being installed when you add/use vue-annotator
    "peerDependencies": {
    "svg.js": "^2.6.4"
    },
    "dependencies": {
    "interactjs": "^1.3.3",
    "svg.draw.js": "^2.0.3",
    "svg.select.js": "^2.1.2"
    }
    }

@patrykKlimczak
Copy link
Author

patrykKlimczak commented Feb 19, 2020

  1. Google Chrome Version: 79.0.3945.130
  2. Vue: 2.5.18

image

I try this:

<v-annotator ref="canvas"
                  class="border"
                  inertia
                  :delete.sync="deletingRect.status"
                  :drawing="true"
                  :minSize="[20, 20]"
                  @select="getSelect"
                  @draw-end="createRect"
                  @resize-end="changeRect"
                  @move-end="changeRect"
                  :grid="[5, 5]">
                  <img draggable="false" :src="screenImg" />
                  <rect slot="drawing" class="rectDrawing" stroke="red"/>
              </v-annotator>

And I need to @draw-end event run select event on refs component @select

@patrykKlimczak
Copy link
Author

I has this methods:

this.$refs.canvas.$listeners.select();

but I have error

image

Scope function on refs:

image

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

2 participants