[Vuejs]-Need to find whether an array is empty or not in vue

3👍

You could know that array is empty by checking its length:

methods: {
    addRange(){  
     if(this.inputs.length===0){       
        this.inputs.push({
            rangField: '',
        })
        }
    },
}

Leave a comment