Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<template>
<div id="app">
<h1>Simple Chessboard with legal moves</h1>
<chessboard ref="cb"/>
</div>
</template>
<script>
import {chessboard} from 'vue-chessboard'
import 'vue-chessboard/dist/vue-chessboard.css'
export default {
name: 'app',
components: {
chessboard
},
mounted() {
let ref_cb = this.$refs.cb
ref_cb.game.move('e4')
ref_cb.board.set({
fen: ref_cb.game.fen(),
turnColor: ref_cb.toColor(),
movable: {
color: ref_cb.toColor(),
dests: ref_cb.possibleMoves(),
},
})
ref_cb.afterMove()
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.