Home

Awesome

Vue-8-puzzle

An itty-bitty slide puzzle game made as Vue.js component

PLAY DEMO

8-puzzle

Images/Videos for source

select-source

Auto-resize

resize

Install and Usage

$ npm install vue-8-puzzle --save
import Vue from 'vue'
import PuzzleBoard from 'vue-8-puzzle'
import videoSrc from 'myvideo.webm'

let v = new Vue({
  el: '#app',
  template: `
    <app>
      <puzzle-board
      :src="videoSrc" />
    </app>`,
  components: {
    PuzzleBoard
  }
})

Props

PropsTypeDescriptionDefault
srcStringsource path-
sourcesArray<Object>source paths-
colsnumbernumber of columns4
rowsnumbernumber of rows4
autoResizebooleanwhen true the component fits to its root automaticallyfalse
showNumberbooleanwhen true the component shows tile numbers on the videotrue

Events

EventPayloadDescription
initnonethe puzzle is initialized
startnonethe tile start to move
changenonethe tile changes
finishnoneall the tile is on correct position