Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

228
Vistas
Drag & Drop Puzzle with drag & drop api, vue and canvas

Im in desperate need for help.

Im trying to create something like https://goodies.pixabay.com/jquery/snap-puzzle/demo.html, just using Vue, Canvas, Drag & Drop API, and regular mouseMove events. However, it seems like whenever im using the mouseMove event for dragging items around the screen, it disables the Drag & Drop api.

For example, Im dragging a tile into one of the slots, nothing happens :( - If I remove the line from the template in Tile.vue

 @mousedown.prevent="updateTilePosition"

It works, however, then I wont have the ability to drag/drop items around the screen. It seems the drag & drop API limits in to the "available slots", and if I try moving one of the tiles in just snaps back to the original position, UNLESS i drag it into one of the available slots then it snaps the tile into the container as expected

The whole code is available here: https://codesandbox.io/s/vue-puzzle-vip9f

Note: Each tile represents a "clip" from the image, using Canvas (However, on Codesandbox it doesn't seem to draw the image, so for the sake of it, just imaging each tile represent something from the main image)

As mentioned, it should work much like the https://goodies.pixabay.com/jquery/snap-puzzle/demo.html - But it seems like the approach im using, it's nearly impossible :( - ANY help would be greatly appreciated

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda