[Vuejs]-VUEJS Call a function in function (axios)

0👍

what about instead add function 2 inside function 1 to call syncs.

func2:function(variable){
    console.log(this.func1(variable)) // undefined..


   func1:function(val){
if(val.x == 0)
{
    axios.post('/...', {

    })
    .then((response) => {
        if(response.data == 0)
        {
            return true;
        }
        else
        {
            return false
        }
    })
    .catch((error) => {
        return false;
    });
}
else
{
    return false;
}

}
}

Leave a comment