Created
February 8, 2018 15:03
-
-
Save ramsaylanier/f5023f11966f7d059e6f43b0e090e270 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> | |
| <div class="page"> | |
| <div class="header"> | |
| <div class="wrapper"> | |
| <h1 class="title">{{game.title}}</h1> | |
| </div> | |
| </div> | |
| <div class="body"> | |
| <div class="wrapper"> | |
| <router-view name="page"/> | |
| </div> | |
| </div> | |
| <modal v-if="showModal" ref="modal"> | |
| <router-view name="rule"/> | |
| </modal> | |
| </div> | |
| </template> | |
| <script> | |
| import games from '@/data/games' | |
| import Modal from '@/components/Modal' | |
| export default { | |
| name: 'Game', | |
| components: { | |
| Modal | |
| }, | |
| data () { | |
| return { | |
| game: games.filter(game => game.id === parseInt(this.$route.params.id))[0], | |
| showModal: this.$route.meta.showModal | |
| } | |
| }, | |
| watch: { | |
| '$route.meta' ({showModal}) { | |
| this.showModal = showModal | |
| } | |
| } | |
| } | |
| </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment