Guest User

Untitled

a guest
Dec 17th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. <template>
  2. <v-app id="app">
  3. <router-view name="sidebar"></router-view>
  4. <router-view name="header"></router-view>
  5. <router-view name="main"></router-view>
  6. <router-view name="footer"></router-view>
  7. </v-app>
  8. </template>
  9. <script>
  10. export default {
  11. name: 'app',
  12. isFoo: false
  13. }
  14. </script>
  15.  
  16. <template>
  17. <div id="sidebar" :isOpen="isFoo"></div>
  18. </template>
  19. <script>
  20. export default {
  21. name: 'sidebar',
  22. data () {
  23. return {isFoo: this.$parent.$options.isFoo}
  24. }
  25. }
  26. </script>
  27.  
  28. <template>
  29. <button v-on:click="foo()">Button</button>
  30. </template>
  31. <script>
  32. export default {
  33. name: 'header',
  34. methods: {
  35. foo: () => {
  36. this.$parent.$options.isFoo = !this.$parent.$options.isFoo
  37. }
  38. }
  39. }
  40. </script>
Add Comment
Please, Sign In to add comment