I'm trying to create a modal but I'm getting this error only when I close it:
[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: "value"
found in
---> <PanelDesconectarModal> at resources\assets\vue\PanelDesconectarModal.vue
<VNavigationDrawer>
<PanelDrawer> at resources\assets\vue\PanelDrawer.vue
<VApp>
<PanelRoot> at resources\assets\vue\PanelRoot.vue
<VApp>
<Root>
PanelDesconectarModal.vue
<template>
<v-dialog v-model="value" max-width="350">
<v-card :dark="($theme === 'dark')">
<v-card-title class="headline">Desconectar</v-card-title>
<v-divider></v-divider>
<v-card-text>Você tem certeza que deseja desconectar-se?</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn flat @click.native="closeDialog">Cancelar</v-btn>
<v-btn :color="$color" flat="flat" @click.native="desconectar">Desconectar</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
<script>
export default {
name: 'panel-desconectar-modal',
props: ['value'],
methods: {
closeDialog() {
this.value = false;
},
desconectar() {
this.closeDialog();
window.location = this.$route + '/panel/desconectar';
}
}
}
</script>
Using ProgressDesconectarModal.vue, showDesconectar is a data variable
<panel-desconectar-modal :value="showDesconectar"></panel-desconectar-modal>