Unknown error

Published 3 months ago by afoysal

I am new in vuejs2. I am getting below error. Could anyone say why this error is coming ? Could you please provide any sample solution for this ?

enter image description here

ModalBody.vue

<script>  
    import SemanticModal from 'vue-ya-semantic-modal'

    export default {        
        components: { SemanticModal: SemanticModal() },
        name: 'ModalBody',
        props: {
            active1: {
                required: true
            }
        },
    }
</script>

DataTable.vue

<script>
import ModalBody from './ModalBody'

export default {
    components: { ModalBody },
    data: function () {
        return  {
            active1: false
        }
    },
    props: {
        columns: {
            required: true
        },
        gdata: {
            required: true
        }
    },
    methods: {
        show () {
            this.active1 = true
        }
    },
}
topvillas

The error tells you how to solve the problem.

ejdelmonico

As topvilla mentioned, the error message advises how to correct the issue. If active1 is not any type of method or calculated property, then set it up in the data property of the component.

cmdobueno

Here is a solution for your issue:

The issue is you are mutating a prop called active1. Props will be overwritten when a component is re-rendered.

The best solution is to create a data prop lets call it active_1 and set that equal to this.active1

afoysal

Thanks @cmdobueno for your reply. I updated my question. Could you please help me now ? Thanks.

Please sign in or create an account to participate in this conversation.