byteshiva / meetups-inspire

Meetup Inspire
https://byteshiva.github.io/meetups-inspire/
Apache License 2.0
1 stars 0 forks source link

[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being mutated: "sideNav" #5

Open byteshiva opened 6 years ago

byteshiva commented 6 years ago

found in

---> at src/components/Navigation/Sidebar/Sidebar.vue

at src/components/Navigation/Navigation.vue at src/App.vue vue.runtime.esm.js:587
byteshiva commented 6 years ago

intermittent solution: observe prop change and update the v-navigtion-bar v-model accordingly.

 <v-navigation-drawer
        v-model="isSelectedChild"
        temporary
        clipped
        floating
        class="blue lighten-1" dark
        app>
   props: ['sideNav'],
   data() {
        return {
            isSelectedChild: this.sideNav
        }
    },
    watch: {
        sideNav: function(newVal, oldVal) { // watch it
            this.isSelectedChild = true;
        }
    }