Guest User

Untitled

a guest
Feb 21st, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. <template>
  2. <div class="page">
  3. <div class="header">
  4. <div class="wrapper">
  5. <h1 class="title">{{game.title}}</h1>
  6. </div>
  7. </div>
  8. <div class="body">
  9. <div class="wrapper">
  10. <router-view name="page"/>
  11. </div>
  12. </div>
  13.  
  14. <modal v-if="showModal" ref="modal">
  15. <router-view name="rule"/>
  16. </modal>
  17. </div>
  18. </template>
  19.  
  20. <script>
  21. import games from '@/data/games'
  22. import Modal from '@/components/Modal'
  23.  
  24. export default {
  25. name: 'Game',
  26. components: {
  27. Modal
  28. },
  29. data () {
  30. return {
  31. game: games.filter(game => game.id === parseInt(this.$route.params.id))[0],
  32. showModal: this.$route.meta.showModal
  33. }
  34. },
  35. watch: {
  36. '$route.meta' ({showModal}) {
  37. this.showModal = showModal
  38. }
  39. }
  40. }
  41. </script>
Add Comment
Please, Sign In to add comment