Created
February 14, 2019 11:07
-
-
Save xseignard/bef5a39e39642547fddbdca605a0400d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template lang="html"> | |
<v-container v-if="clock" class="screen" fluid fill-height> | |
{{room.timer}} | |
</v-container> | |
<v-container v-else class="alert" fluid fill-height> | |
Some non-reactive stuff. | |
</v-container> | |
</template> | |
<script> | |
import { mapState } from 'vuex'; | |
export default { | |
data: () => ({ | |
clock: true, | |
}), | |
computed: { | |
...mapState({ | |
room(state) { | |
return state.rooms[this.$route.params.roomId * 2 - 1]; | |
}, | |
}), | |
}, | |
updated() { | |
if (this.room.open && this.clock) { | |
this.clock = false; | |
// do some non reactive computations | |
else { | |
this.clock = true; | |
// do some computation with the updated state | |
} | |
}, | |
}; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ca, ça marche par contre ?!