Select Git revision
OXCell.vue 550 B
<template>
<div
@click="clickCell"
:class="{ cell: true, cellX: player === 'X', cellO: player === 'O' }"
>
{{ player }}
</div>
</template>
<script>
export default {
props: ['player', 'row', 'col'],
methods: {
clickCell (event) {
// console.log(event)
// console.log('click ' + this.row + ' ' + this.col)
if (this.player !== '-') return
this.$emit('cell-click', this.row, this.col)
}
}
}
</script>
<style>
.cell {
font-size: 30pt;
}
.cellX {
color: blue;
}
.cellO {
color: red;
}
</style>