Ahora el dora se establece en el store en lugar del componente Juego.vue

This commit is contained in:
Araozu 2020-10-17 10:10:54 -05:00
parent bbb481ea1e
commit 02296a8d48
2 changed files with 6 additions and 12 deletions

View File

@ -1,6 +1,6 @@
<template lang="pug">
div
contenedor-dora(:dora="dora" :doraOculto="doraOculto" :turnosRestantes="turnosDora")
contenedor-dora(:turnosRestantes="turnosDora")
div.con-int-juego
div.cont-2-juego
div.cont-cuadrante-cartas-juego

View File

@ -14,37 +14,31 @@ div.contenedor-dora
import {defineComponent, computed} from "vue";
import { useDimensions } from "@/components/useDimensions";
import carta from "@/components/carta.vue";
import { useStore } from "vuex";
export default defineComponent({
name: "contenedor-dora",
components: {carta},
props: {
dora: {
type: Array,
default: [0, 0, 0, 0, 0]
},
doraOculto: {
type: Array,
default: [0, 0, 0, 0, 0]
},
turnosRestantes: {
type: Number,
default: 32
}
},
setup(props) {
setup() {
const store = useStore();
const {pH} = useDimensions();
const pHc = computed(() => pH.value + "px");
const doraCerrado = computed(() => {
const narr = [...props.dora];
const narr = [...store.state.dora[0]];
for (let i = narr.length; i < 5; i++) {
narr.push(0);
}
return narr;
});
const doraAbierto = computed(() => {
const narr = [...props.doraOculto];
const narr = [...store.state.dora[1]];
for (let i = narr.length; i < 5; i++) {
narr.push(0);
}