Added game state to all components, renamed timeout to timeoutMilliseconds, removed score from savegame.

This commit is contained in:
2020-12-21 15:48:20 +01:00
parent 639fcf8c6e
commit c4b914ccfd
11 changed files with 128 additions and 91 deletions

View File

@@ -3,19 +3,24 @@
<h2>Code-Matrix</h2>
<div class="matrix-row" v-for="i in size" :key="i">
<div class="matrix-column" v-for="j in size" :key="j">
{{matrix[(i - 1)*5 + (j - 1)]}}
{{matrix[(i - 1)*size + (j - 1)]}}
</div>
</div>
</div>
</template>
<script lang="ts">
import {defineComponent} from "vue";
import {defineComponent, inject} from "vue";
export default defineComponent({
props: {
size: {type: Number, required: true},
matrix: {type: Array, required: true},
setup() {
const size = inject("size");
const matrix = inject("matrix");
return {
size,
matrix
}
}
});
</script>