Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

232
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda