Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <template>
- <v-app id="app">
- <router-view name="sidebar"></router-view>
- <router-view name="header"></router-view>
- <router-view name="main"></router-view>
- <router-view name="footer"></router-view>
- </v-app>
- </template>
- <script>
- export default {
- name: 'app',
- isFoo: false
- }
- </script>
- <template>
- <div id="sidebar" :isOpen="isFoo"></div>
- </template>
- <script>
- export default {
- name: 'sidebar',
- data () {
- return {isFoo: this.$parent.$options.isFoo}
- }
- }
- </script>
- <template>
- <button v-on:click="foo()">Button</button>
- </template>
- <script>
- export default {
- name: 'header',
- methods: {
- foo: () => {
- this.$parent.$options.isFoo = !this.$parent.$options.isFoo
- }
- }
- }
- </script>
Add Comment
Please, Sign In to add comment