[Vuejs]-Data function of Parent is called twice

0👍

That is because you declared and called filterAll() within data scope, and then you set it as prop for component, and it is called again. You should move your filterAll() method in methods, and remove it from prop for component.

data(){
    return{
        filtervalue : this.filterAll()
    }
},

methods:{
    filterAll()
    {
        console.log(11111111111);
    }
}

Leave a comment