Gitlab@Informatics

Skip to content
Snippets Groups Projects
Select Git revision
  • b7f098c6d22be92e11e37cf80cd341c955f7f48b
  • master default protected
2 results

OXCell.vue

Blame
  • 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>